Loading

Quipoin Menu

Learn • Practice • Grow

sql / Keys in SQL
mcq
Direction: Choose the correct option

Q1.

What is a primary key?
A. Index for searching
B. Key to another table
C. First column in table
D. Unique identifier for each row
Direction: Choose the correct option

Q2.

CREATE TABLE students (
id INT PRIMARY KEY,
name VARCHAR(50)
);
What constraint does id have?
A. Foreign key
B. Primary key
C. Unique only
D. Not null
Direction: Choose the correct option

Q3.

What is a foreign key?
A. Key that references another table
B. Key that is indexed
C. Key that is first in table
D. Key that is unique
Direction: Choose the correct option

Q4.

How many primary keys can a table have?
A. One
B. Zero
C. Unlimited
D. Multiple
Direction: Choose the correct option

Q5.

What's the difference between PRIMARY KEY and UNIQUE?
A. Primary key cannot be NULL, UNIQUE can
B. Primary key allows NULL
C. Unique is faster
D. Both are same