Mysql Foreign Keys


  1. Which clause in the SQL standard controls how NULL values in a composite foreign key are handled when comparing to a primary key.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    The MATCH clause in the SQL standard controls how NULL values in a composite (multiple-column) foreign key are handled when comparing to a primary key. MySQL essentially implements the semantics defined by MATCH SIMPLE.


  1. Which keyword is used to specify the foreign key after the table is created?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    When the table has already been created but the foreign key has not been set of foreign key constraints are not specified, the ‘ALTER TABLE – ADD FOREIGN KEY’ clause is used.



  1. Which clause is used to remove a foreign key constraint?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In MySQL foreign key definition syntax, there are various components. A foreign key links one table to another table in the table. To remove a foreign key constraint, the ‘DROP’ clause is used.


  1. If the storage engine InnoDB is not used, foreign key cannot be used.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The foreign key support is exclusively provided by the storage engine named InnoDB. Without its inclusion, foreign keys cannot be used. However it is possible to implement with application logic.



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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    In MySQL foreign key definition syntax, there are various components, namely, FOREIGN KEY, CONSTRAINT, REFERENCES and ON DELETE. The REFERENCES clause names the parent table and the index columns in the table.