What is a subquery in SQL? MCQ with Answer and Explanation

What is a subquery in SQL?
A. A query that is used to create a table
B. A query nested inside another query
C. A query that returns multiple results
D. A query that is always correlated
Answer: Option B
Solution (By JKSSB Mock Tests)
A subquery is a SELECT statement nested within another SQL statement (e.g., SELECT, INSERT, UPDATE, DELETE).

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Database Management System (DBMS) Questions

Question #1
What is the concept of referential integrity?
A. Ensuring data is normalized
B. Ensuring that all primary keys are unique
C. Ensuring that no null values exist
D. Ensuring that foreign key values match primary key values in the referenced table

Correct Answer: Option D


Explanation:
Referential integrity ensures that relationships between tables remain consistent, meaning foreign key values must have corresponding primary key values.

This question belongs to: Computer Database Management System (DBMS)
Question #2
What is the purpose of the COMMIT statement in SQL?
A. To start a new transaction
B. To permanently save all changes made in a transaction
C. To save a point within a transaction
D. To undo all changes made in a transaction

Correct Answer: Option B


Explanation:
COMMIT finalizes a transaction, making all changes permanent in the database.

This question belongs to: Computer Database Management System (DBMS)
Question #3
Which language is used to define the structure of a database, such as creating tables and constraints?
A. DCL
B. TCL
C. DML
D. DDL

Correct Answer: Option D


Explanation:
Data Definition Language (DDL) is used to define and modify the database schema, including CREATE, ALTER, and DROP statements.

This question belongs to: Computer Database Management System (DBMS)