SQL - Table ConstraintsWhich of the following best describes the role of a FOREIGN KEY constraint in a database?AIt speeds up queries by indexing columns.BIt automatically deletes all records in a table.CIt ensures data in one table matches data in another table.DIt encrypts data stored in the table.Check Answer
Step-by-Step SolutionSolution:Step 1: Define foreign key purposeA foreign key links a column in one table to a primary key in another, ensuring data consistency.Step 2: Eliminate unrelated optionsSpeeding queries, deleting records, and encrypting data are unrelated to foreign keys.Final Answer:It ensures data in one table matches data in another table. -> Option CQuick Check:Foreign key = data consistency between tables [OK]Quick Trick: Foreign keys link tables by matching data values [OK]Common Mistakes:MISTAKESConfusing foreign keys with indexesThinking foreign keys delete data automaticallyAssuming foreign keys encrypt data
Master "Table Constraints" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Advanced Joins - Natural join and its risks - Quiz 15hard Aggregate Functions - COUNT function behavior - Quiz 6medium Aggregate Functions - MIN and MAX functions - Quiz 14medium Set Operations - Set operation column matching rules - Quiz 14medium Subqueries - Nested subqueries - Quiz 4medium Subqueries - Subquery in FROM clause (derived table) - Quiz 12easy Table Relationships - Foreign key linking mental model - Quiz 13medium Views - Updatable views and limitations - Quiz 6medium Views - CREATE VIEW syntax - Quiz 4medium Views - CREATE VIEW syntax - Quiz 1easy