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 update records
B. To create a table
C. To implement conditional logic within a query
D. To delete records
Answer: Option C
Solution (By JKExamLibrary)
CASE allows for conditional expressions, similar to IF-THEN-ELSE, within SQL statements.

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

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1 Report Error
What is the purpose of the SQL 'NULL' value?
A. To represent zero
B. To represent empty string
C. To represent an error
D. To represent missing or unknown data

Correct Answer: Option D


Explanation:
NULL is a special marker indicating that a value is unknown or missing, not the same as zero or empty string.

This question belongs to: Computer Database Management System (DBMS)
Question #2 Report Error
What is a database schema?
A. A backup file
B. A query result
C. The overall design or structure of the database, including tables, columns, and relationships
D. A single table

Correct Answer: Option C


Explanation:
A schema is the logical description of the entire database, defining tables, views, indexes, and constraints.

This question belongs to: Computer Database Management System (DBMS)
Question #3 Report Error
Which of the following is a DCL (Data Control Language) command?
A. GRANT
B. CREATE
C. SELECT
D. COMMIT

Correct Answer: Option A


Explanation:
GRANT and REVOKE are DCL commands. COMMIT is TCL, SELECT is DML, CREATE is DDL.

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