Home > Database > Mysql Tutorial > What should you pay attention to when using SQL statements in mysql?

What should you pay attention to when using SQL statements in mysql?

PHPz
Release: 2023-05-27 09:28:12
forward
1195 people have browsed it

1. It is forbidden to use select* and only obtain the necessary fields.

2. Insert must specify a field, and insert into T values() is prohibited.

3. Do not use count (column name) or count (constant) instead of count (*).

4. Foreign keys and cascades are not allowed, and all foreign key concepts must be solved at the application layer.

Example

说明:`NULL` 与任何值的直接比较都为 `NULL`。
1) `NULL<>NULL` 的返回结果是 `NULL`,而不是 `false`。
2) `NULL=NULL` 的返回结果是 `NULL`,而不是 `true`。
3) `NULL<>1` 的返回结果是 `NULL`,而不是 `true`。
Copy after login

The above is the detailed content of What should you pay attention to when using SQL statements in mysql?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template