Basic SQL MCQs
SQL MCQ Questions
🔹 Basic SQL MCQs
-
What does SQL stand for?
A) Structured Query List
B) Simple Query Language
C) Structured Query Language
D) Standard Question Language
Answer: C
-
Which SQL statement is used to extract data from a database?
A) GET
B) SELECT
C) EXTRACT
D) FETCH
Answer: B
-
Which of the following is not a valid SQL data type?
A) VARCHAR
B) INT
C) BOOLEAN
D) WORD
Answer: D
-
Which clause is used to filter records in SQL?
A) ORDER BY
B) WHERE
C) GROUP BY
D) FROM
Answer: B
-
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
-
Which function is used to count rows in SQL?
A) SUM()
B) TOTAL()
C) COUNT()
D) NUMBER()
Answer: C
-
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
-
Which keyword is used to sort query results?
A) FILTER BY
B) GROUP BY
C) SORT BY
D) ORDER BY
Answer: D
-
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
-
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
-
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
-
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
-
Which statement is used to change existing data in a table?
A) MODIFY
B) UPDATE
C) EDIT
D) CHANGE
Answer: B
-
Which SQL constraint ensures that all values in a column are different?
A) UNIQUE
B) CHECK
C) NOT NULL
D) PRIMARY
Answer: A
-
Which of the following is not a DML (Data Manipulation Language) command?
A) SELECT
B) DELETE
C) INSERT
D) CREATE
Answer: D