N/APosted on - 04/02/2012
In database created with SQL language,when the primary key is deleted in one table;
every table referred to this key will be deleted automatically?
Effect of the primary key on the other tables
Primary key is an attribute in one table that has been referenced in other tables. A concept of data integrity in database is important in any database system that “A primary key attribute value cannot be edited or deleted until there are referenced values of the primary data else where in any other table”. So the main answer to it is you cannot do that.
For this if you want to delete the key F01, then delete/change the row(s) with FO1 in the referenced table and then you have to delete/change the row having the primary attribute value F01. In other words, delete the foreign key first then the primary key.