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`。
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!