Basic SQL MCQs


SQL MCQ Questions

🔹 Basic SQL MCQs

  1. What does SQL stand for?

    A) Structured Query List

    B) Simple Query Language

    C) Structured Query Language

    D) Standard Question Language

    Answer: C

  2. Which SQL statement is used to extract data from a database?

    A) GET

    B) SELECT

    C) EXTRACT

    D) FETCH

    Answer: B

  3. Which of the following is not a valid SQL data type?

    A) VARCHAR

    B) INT

    C) BOOLEAN

    D) WORD

    Answer: D

  4. Which clause is used to filter records in SQL?

    A) ORDER BY

    B) WHERE

    C) GROUP BY

    D) FROM

    Answer: B

  5. What does the LIMIT clause do?

    A) Limits the number of tables

    B) Limits column names

    C) Limits the number of rows returned

    D) Limits the number of users

    Answer: C

🔹 Intermediate SQL MCQs

  1. Which function is used to count rows in SQL?

    A) SUM()

    B) TOTAL()

    C) COUNT()

    D) NUMBER()

    Answer: C

  2. What is the purpose of the JOIN clause?

    A) To delete duplicate records

    B) To merge rows within a single table

    C) To combine rows from two or more tables

    D) To create a new table

    Answer: C

  3. Which keyword is used to sort query results?

    A) FILTER BY

    B) GROUP BY

    C) SORT BY

    D) ORDER BY

    Answer: D

  4. Which of the following is not a type of JOIN in SQL?

    A) INNER JOIN

    B) OUTER JOIN

    C) SIDE JOIN

    D) LEFT JOIN

    Answer: C

  5. Which clause is used with GROUP BY to filter grouped data?

    A) WHERE

    B) ORDER BY

    C) HAVING

    D) LIMIT

    Answer: C

🔹 Advanced SQL MCQs

  1. What does the IS NULL condition test for?

    A) Zero value

    B) Empty string

    C) Missing or undefined value

    D) All of the above

    Answer: C

  2. A subquery that uses values from the outer query is called:

    A) Inline subquery

    B) Static subquery

    C) Correlated subquery

    D) Inner join

    Answer: C

  3. Which statement is used to change existing data in a table?

    A) MODIFY

    B) UPDATE

    C) EDIT

    D) CHANGE

    Answer: B

  4. Which SQL constraint ensures that all values in a column are different?

    A) UNIQUE

    B) CHECK

    C) NOT NULL

    D) PRIMARY

    Answer: A

  5. Which of the following is not a DML (Data Manipulation Language) command?

    A) SELECT

    B) DELETE

    C) INSERT

    D) CREATE

    Answer: D