Home > Database > Mysql Tutorial > 'The difference between MySQL and standard SQL'

'The difference between MySQL and standard SQL'

PHPz
Release: 2023-08-24 23:41:11
forward
634 people have browsed it

The difference between MySQL and standard SQL

Let us understand the difference between MySQL and standard SQL. MySQL performs many operations In some cases, things work differently −

Permissions

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.

Foreign key constraints

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.

Comments

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!

source:tutorialspoint.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