No of visitors who read this post: 184
Category: Database
Type: Question
No votes yet

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?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

#

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.
 
Thanks