SQL MCQ Questions

SQL MCQ Questions are an essential resource for anyone looking to sharpen their database management skills. Covering a broad range of topics from basic SQL commands like SELECT, INSERT, and UPDATE to advanced concepts such as joins, subqueries, and normalization, these multiple-choice questions help learners at all levels improve their SQL knowledge. Whether you're preparing for exams, interviews, or just want to test your understanding, these MCQs will help you master SQL and boost your confidence in database management.

Q1. Which SQL command is used to retrieve data from a database?

Correct Answer: B

SELECT is used to retrieve data from a database table.

Q2. Which SQL command is used to add new records to a table?

Correct Answer: A

INSERT is used to add new rows to a table.

Q3. Which SQL command is used to modify existing records?

Correct Answer: A

UPDATE modifies existing records in a table.

Q4. Which SQL command is used to remove records from a table?

Correct Answer: A

DELETE removes rows from a table without deleting the table itself.

Q5. Which clause is used to filter results in SQL?

Correct Answer: A

WHERE specifies conditions to filter query results.

Q6. Which SQL keyword is used to sort query results?

Correct Answer: C

ORDER BY sorts query results in ascending or descending order.

Q7. Which function counts the number of rows in a table?

Correct Answer: B

COUNT() returns the number of rows in a result set.

Q8. Which SQL keyword is used to combine rows from two or more tables?

Correct Answer: A

JOIN combines rows from multiple tables based on a related column.

Q9. Which SQL command removes a table and its data permanently?

Correct Answer: A

DROP deletes the entire table structure and its data.

Q10. Which SQL command quickly deletes all rows but keeps the table structure?

Correct Answer: C

TRUNCATE removes all rows efficiently but keeps the table.

Q11. Which SQL keyword groups rows sharing a property?

Correct Answer: A

GROUP BY aggregates rows with similar column values.

Q12. Which clause filters groups created by GROUP BY?

Correct Answer: B

HAVING filters groups after aggregation.

Q13. Which SQL data type is used for textual data?

Correct Answer: B

VARCHAR stores variable-length text.

Q14. Which SQL data type is used for true/false values?

Correct Answer: A

BOOLEAN stores TRUE or FALSE values.

Q15. Which keyword eliminates duplicate rows in a SELECT query?

Correct Answer: A

DISTINCT ensures only unique rows are returned.

Q16. Which SQL function calculates the average value of a numeric column?

Correct Answer: B

AVG() calculates the mean of a numeric column.

Q17. Which clause specifies the table to query in SQL?

Correct Answer: A

FROM indicates the table(s) to query data from.

Q18. Which operator is used to match a pattern in SQL?

Correct Answer: B

LIKE is used with wildcards (%) or (_) to match patterns.

Q19. Which SQL keyword combines results of two SELECT queries?

Correct Answer: A

UNION merges results of multiple SELECT statements.

Q20. Which function finds the maximum value in a column?

Correct Answer: A

MAX() returns the highest value in a column.

Latest Blogs