Effect of the primary key on the other tables

Asked By 0 points N/A Posted on -

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?

Answered By 0 points N/A #97461

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.

Login/Register to Answer

Related Questions