Mysql implements cascade operations (cascade update and cascade deletion) and mysql implements
1. Create two tables stu, SC
Create table stu (sid int UNSIGNED primary key auto_increment, name varchar (20) not null) TYPE = InnoDB charset = utf8;
[Mysql] the disadvantage of external key cascade and cascade, mysql key-level disadvantage
When creating a table, you can set delete and update to cascade. An example is used to describe the concept of cascade of Foreign keys.
Assume that a
Parent-Child tables are often involved when adding, modifying, and deleting records in a database.For example, a province table and a city table have a foreign key province_id referenced to the primary key of the province table. In this way, we can
MySQL supports foreign key storage engine only InnoDB, when creating foreign keys, requires the parent table must have a corresponding index, the child table when creating foreign keys will also automatically create the corresponding index. When you
MySQL supports foreign key storage engine only InnoDB, when creating foreign keys, requires the parent table must have a corresponding index, the child table when creating foreign keys will also automatically create the corresponding index. When you
We usually have this requirement: delete the records in Table 1, and you need to delete several records related to table 1 in the other tables.For this, we have two workarounds:One, foreign key constraints using the InnoDB tableALTER TABLE ' score
The use of foreign keys in MySQL to implement cascade Delete, updateMySQL supports foreign key storage engine only InnoDB, when creating foreign keys, requires the parent table must have a corresponding index, the child table when creating foreign
When you are building a table, you can set up cascading for deleting delete and modifying update. The concept of a foreign-key cascade Cascade is illustrated with an exampleIf there is a usertable in the database as follows:This user table is very
Mysql cascade operations (instances) and mysql-level operation instances
MySQL only supports the InnoDB Storage engine for Foreign keys. When creating foreign keys, the parent table must have corresponding indexes, when a sub-Table creates a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.