Machine-translated by Google. Questions are authored in English.
Top

Discussion

SQL Server automatically creates an index on:

  • A.primary keys only.
  • B.foreign key only.
  • C.both primary and foreign keys.
  • D.SQL Server never automatically creates an index.

Answer: C

Correct answer: both primary and foreign keys.

SQL Server creates a unique index on the primary key automatically, since it must enforce uniqueness, and it indexes foreign keys as well. Both are worth having: the primary key index enforces entity integrity, and the foreign key index makes the joins and the referential integrity checks efficient.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.