What is the purpose of the SQL 'WITH' clause (Common Table Expression)? MCQ with Answer and Explanation

What is the purpose of the SQL 'WITH' clause (Common Table Expression)?
A. To create a view
B. To update data
C. To delete data
D. To define a temporary result set that can be referenced within a query
Answer: Option D
Solution (By JKSSB Mock Tests)
A Common Table Expression (CTE) provides a temporary named result set that can be used within a SELECT, INSERT, UPDATE, or DELETE statement.

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1
Which of the following is a property of a database that ensures transactions are isolated from each other?
A. Atomicity
B. Durability
C. Consistency
D. Isolation

Correct Answer: Option D


Explanation:
Isolation ensures that concurrent execution of transactions results in a state that is equivalent to some serial execution.

This question belongs to: Computer Database Management System (DBMS)
Question #2
Which of the following is an example of DML command?
A. INSERT
B. CREATE
C. ALTER
D. DROP

Correct Answer: Option A


Explanation:
INSERT is a Data Manipulation Language (DML) command used to add data to tables.

This question belongs to: Computer Database Management System (DBMS)
Question #3
What is a database cursor?
A. A control structure that enables traversal over rows in a result set
B. A user account
C. A backup file
D. A type of index

Correct Answer: Option A


Explanation:
A cursor allows row-by-row processing of query results, often used in procedural extensions of SQL.

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