Loading

Quipoin Menu

Learn • Practice • Grow

sql / Index Optimization
mcq
Direction: Choose the correct option

Q1.

What is a composite index?
A. Index on multiple columns
B. Unique index
C. Primary key
D. Index on one column
Direction: Choose the correct option

Q2.

CREATE INDEX idx_name ON employees(last_name, first_name);
Which query will use this index?
A. WHERE first_name = 'John'
B. WHERE last_name LIKE '%son'
C. WHERE first_name LIKE 'J%'
D. WHERE last_name = 'Smith'
Direction: Choose the correct option

Q3.

What is a covering index?
A. Index that covers entire table
B. Index on all tables
C. Primary key index
D. Index containing all needed columns
Direction: Choose the correct option

Q4.

SELECT dept_id, salary FROM employees WHERE dept_id = 5;
What index would cover this query?
A. INDEX(dept_id)
B. INDEX(dept_id, salary)
C. INDEX(salary)
D. PRIMARY KEY
Direction: Choose the correct option

Q5.

When can indexes hurt performance?
A. Only help selects
B. Only on large tables
C. Too many indexes on write-heavy tables
D. Always help