Examveda

Which clause names the parent table and the index columns in the table?

A. REFERENCES

B. ON DELETE

C. CONSTRAINT

D. FOREIGN KEY

Answer: Option A

Solution (By Examveda Team)

This question asks about the clause in MySQL that specifically tells us the name of the parent table and the columns used for indexing in that table.
Let's look at the options:
Option A: REFERENCES
This clause is used to define a foreign key constraint. It tells us that the column in the current table (the child table) is related to a specific column in another table (the parent table). However, it doesn't directly name the parent table or its index columns.
Option B: ON DELETE
This clause is used within a FOREIGN KEY constraint. It determines what happens to the rows in the child table when a row in the parent table is deleted. It doesn't name the parent table or its index columns.
Option C: CONSTRAINT
This clause is used to define a constraint, which is a rule that enforces data integrity in a table. While it can be used for foreign keys, it doesn't directly name the parent table or its index columns.
Option D: FOREIGN KEY
This clause is used to define a foreign key constraint and it does include the parent table name and the index columns of the parent table within the constraint definition.
Therefore, the correct answer is Option D: FOREIGN KEY.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous