Primary & Unique key have automatic indexes - Create an index on foreign key

Q.  Which key have automatically indexes, but you might want to create an index on a foreign key?

- Published on 12 Aug 15

a. Primary
b. Unique
c. Both A & B
d. None of the above

ANSWER: Both A & B
 

    Discussion

  • Nirja Shah   -Posted on 28 Sep 15
    - Primary and unique keys automatically have indexes, but you might want to create an index on a foreign key

    - Primary key - It is a single field or combination of fields that uniquely defines a record.
    - None of the fields that are part of the primary key can contain a null value.
    - A table can have only one primary key.

    - Unique Key - It is a single field or combination of fields that uniquely defines a record.
    - Some of the fields can contain null values as long as the combination of values is unique.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)