Microsoft SQL Server Database Quiz Questions

Chapter Name:Chapter 8 - RDBMS Concepts
Lesson Content Link:Foreign Key
Current Quiz Count:45
Progress
0%
Q1
True / False

A foreign key is used to uniquely identify each row in a table.

Q2
True / False

A foreign key constraint ensures the referential integrity of the data in one table to match values in another table.

Q3
True / False

A foreign key in one table points to a primary key in another table.

Q4
True / False

Foreign keys can be null.

Q5
True / False

A table can have multiple foreign keys.

Q6
True / False

The foreign key constraint prevents actions that would destroy links between tables.

Q7
True / False

A foreign key must reference an existing primary key in the parent table.

Q8
True / False

Deleting a row in a parent table will always delete related rows in the child table if a foreign key is present.

Q9
True / False

Foreign keys cannot reference columns that are not primary keys in the parent table.

Q10
True / False

Foreign keys are primarily used for maintaining data integrity.

Q11
True / False

The SQL standard does not require support for foreign key constraints.

Q12
True / False

A foreign key constraint can be added to an existing table.

Q13
True / False

A foreign key relationship can be created between two columns in the same table.

Q14
True / False

Foreign keys do not allow duplicate values in the child table.

Q15
True / False

A foreign key can reference a non-primary key column in the parent table if that column has a unique constraint.

Q16
Single Choice

Which of the following best describes a foreign key?

Q17
Single Choice

What is the primary purpose of a foreign key?

Q18
Single Choice

Which SQL clause is used to create a foreign key?

Q19
Single Choice

What happens when a row with a foreign key is deleted in the child table?

Q20
Single Choice

Which command is used to add a foreign key to an existing table?

Q21
Single Choice

Which of the following statements is true about foreign keys?

Q22
Single Choice

Which of the following is a correct statement regarding foreign keys?

Q23
Single Choice

What is the main advantage of using foreign keys?

Q24
Single Choice

Which of the following best describes the CASCADE option in a foreign key constraint?

Q25
Single Choice

What happens when a parent row is deleted and the foreign key constraint has ON DELETE CASCADE option?

Q26
Single Choice

Which SQL keyword is used to enforce referential integrity in a table?

Q27
Single Choice

Which of the following is true about foreign keys and NULL values?

Q28
Single Choice

Which command would you use to remove a foreign key constraint from a table?

Q29
Single Choice

Which of the following can be enforced using a foreign key constraint?

Q30
Single Choice

What is the default action of a foreign key constraint on update or delete in SQL Server if no action is specified?

Q31
Multiple Choice

Which of the following are true regarding foreign keys? Select all that apply.

Q32
Multiple Choice

Select the correct statements about foreign keys. (Choose three)

Q33
Multiple Choice

Foreign keys can reference which types of columns? (Select all that apply)

Q34
Single Choice

Which SQL clause specifies what should happen when a referenced row in the parent table is updated?

Q35
Single Choice

What is the purpose of the SET NULL option in a foreign key constraint?

Q36
Single Choice

Which clause in SQL Server is used to enforce foreign key constraints?

Q37
Single Choice

Which option in a foreign key constraint specifies that child rows should be updated when the parent row is updated?

Q38
Single Choice

Which SQL Server feature helps maintain referential integrity between tables?

Q39
Single Choice

When a foreign key column is modified, which SQL clause is used to define how changes should propagate to the related rows?

Q40
Single Choice

Which option ensures that when a referenced row in the parent table is deleted, the corresponding child rows are also deleted?

Q41
Single Choice

Which SQL Server feature is used to specify actions that should occur when a foreign key relationship is updated or deleted?

Q42
Multiple Choice

Which of the following actions can be taken on foreign key constraints?

Q43
Multiple Choice

Select the correct actions related to foreign keys when a referenced row is deleted.

Q44
Single Choice

Which SQL Server statement is used to enforce the actions defined in a foreign key constraint?

Q45
Multiple Choice

Select the valid options for handling foreign key constraints in SQL Server.