Loading

Quipoin Menu

Learn • Practice • Grow

sql / Query Optimization
mcq
Direction: Choose the correct option

Q1.

Why is query optimization important?
A. More indexes
B. Faster performance, less server load
C. Complex queries
D. More code
Direction: Choose the correct option

Q2.

EXPLAIN SELECT * FROM employees WHERE salary > 50000;
What does EXPLAIN do?
A. Shows query execution plan
B. Validates syntax
C. Runs query
D. Creates index
Direction: Choose the correct option

Q3.

Which query is better optimized?
A. SELECT * FROM orders WHERE YEAR(order_date) = 2023
B. B,Neither
C. A,Both are same
D. SELECT * FROM orders WHERE order_date BETWEEN '2023-01-01' AND '2023-12-31'
Direction: Choose the correct option

Q4.

What are query optimization tips?
A. Avoid functions on indexed columns
B. Use indexes, avoid SELECT *
C. Use JOINs instead of subqueries
D. All of the above
Direction: Choose the correct option

Q5.

SELECT * FROM orders WHERE YEAR(order_date) = 2023;
How can this be optimized?
A. Use different function
B. No improvement needed
C. Use range condition: order_date BETWEEN '2023-01-01' AND '2023-12-31'
D. Add index on YEAR(order_date)