Which of the following is a valid SQL statement to create a view? MCQ with Answer and Explanation

Which of the following is a valid SQL statement to create a view?
A. CREATE VIEW view_name (columns) AS SELECT ...;
B. CREATE VIEW view_name AS SELECT ...;
C. Both A and B
D. Neither
Answer: Option C
Solution (By JKExamLibrary)
Both syntaxes are valid: CREATE VIEW view_name AS SELECT ... and with column aliases.

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 a data mart?
A. A subset of a data warehouse focused on a specific business unit or function
B. A query language
C. A type of database
D. A backup technique

Correct Answer: Option A


Explanation:
A data mart is a specialized data warehouse for a specific department, team, or subject area.

This question belongs to: Computer Database Management System (DBMS)
Question #2 Report Error
The JOIN operation in SQL is used to:
A. Sort data
B. Delete rows
C. Create a new database
D. Combine rows from two or more tables

Correct Answer: Option D


Explanation:
JOIN combines data from multiple tables based on related columns.

This question belongs to: Computer Database Management System (DBMS)
Question #3 Report Error
Which constraint ensures that all values in a column are unique?
A. FOREIGN KEY
B. UNIQUE
C. PRIMARY KEY
D. CHECK

Correct Answer: Option B


Explanation:
UNIQUE constraint ensures that all values in a column are distinct, but allows NULL (unless combined with NOT NULL).

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