Let us understand the difference between MySQL and standard SQL. MySQL performs many operations In some cases, things work differently −
There are many differences between MySQL and standard SQL when it comes to granting user permissions. In MySQL, when a table is deleted, the table's permissions are not automatically revoked. You need to explicitly use the REVOKE statement to revoke table permissions.
MySQL’s implementation of foreign key constraints is different from the SQL standard. If there are many rows in the parent table with the same reference key value, the InnoDB engine does a foreign key check for other parent rows with the same key value to make sure they do not exist.
For example, if a constraint of type RESTRICT is defined and there are child rows with multiple parent rows, InnoDB will not allow deletion of the parent row.
In SQL statements that insert, delete, or update multiple rows, foreign key constraints (such as unique constraints) are checked row by row. When performing a foreign key check, InnoDB sets a shared row-level lock on the child record or parent record that needs to be checked.
For performance reasons, MySQL requires that reference columns must be indexed. But MySQL does not enforce that referenced columns must be unique or declared non-null.
Standard SQL uses C syntax /* this is a comment */ to express comments MySQL server also supports this syntax. Standard SQL uses ''--'' as the sequence to start a comment. MySQL server uses '#' as the character to start a comment.
The above is the detailed content of 'The difference between MySQL and standard SQL'. For more information, please follow other related articles on the PHP Chinese website!