10 Questions
What is the primary purpose of a primary key in a database table?
To ensure that each row in the table is unique and identifiable
Which of the following is a valid constraint for a primary key column?
The column must be unique within the entire table
What is the purpose of a foreign key in a database table?
To establish a relationship between two tables
What is the relationship between the 'Department' table and the 'Employee' table in the given example?
The 'Department' table is the parent table, and the 'Employee' table is the child table
What is the purpose of referential integrity in a database?
To establish and maintain logical relationships between tables to avoid data corruption
What is the main concept of REFERENTIAL INTEGRITY?
It does not allow to add any record in a table that contains the foreign key unless the reference table containing a corresponding primary key.
What is the first database rule of Referential Integrity?
You must check that there are no records in related tables that require the record which you are deleting.
What is the second database rule of Referential Integrity?
You must check that the related information exists in parent table in PK column before adding information to a table.
What happens if you try to delete a primary key that has dependencies (foreign keys related to it)?
You can not delete the primary key if it has Dependencies (FK related to it).
What is the relationship between a Primary Key (PK) and a Foreign Key (FK)?
The value of a FK must exist in the PK column it refers to.
Learn the basic concepts of primary keys in databases, including rules for defining primary keys and types of primary keys such as single primary key. Understand how primary keys uniquely identify rows in a table.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free