What is the purpose of the SQL 'CASE' statement? MCQ with Answer and Explanation

What is the purpose of the SQL 'CASE' statement?
A. To delete records
B. To update records
C. To create a table
D. To implement conditional logic within a query
Answer: Option D
Solution (By JKSSB Mock Tests)
CASE allows for conditional expressions, similar to IF-THEN-ELSE, within SQL statements.

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1
The total number of attributes (columns) present in a relation determines its what?
A. Schema
B. Cardinality
C. Domain
D. Degree

Correct Answer: Option D


Explanation:
The number of attributes or columns in a relation is defined as the degree of that relation.

This question belongs to: Computer Database Management System (DBMS)
Question #2
Which data model uses objects, classes, and inheritance features, mirroring concepts from object-oriented programming?
A. Network Data Model
B. Relational Data Model
C. Flat Data Model
D. Object-Oriented Data Model

Correct Answer: Option D


Explanation:
The Object-Oriented Data Model integrates object-oriented programming languages directly with databases, storing data as objects with attributes and methods.

This question belongs to: Computer Database Management System (DBMS)
Question #3
A candidate key is:
A. A foreign key only
B. Any key with duplicates
C. Always the primary key
D. A minimal super key

Correct Answer: Option D


Explanation:
A candidate key is a minimal set of attributes that can uniquely identify a tuple.

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