SQL MCQs – Introduction to Databases

11.) What does the DISTINCT keyword do?

A) Selects unique records
B) Deletes duplicate records
C) Sorts records
D) Filters records

Answer: Option A

Explanation: DISTINCT eliminates duplicate records in the result set.

12.) Which command is used to create a new table in a database?

A) INSERT
B) CREATE TABLE
C) ADD TABLE
D) NEW TABLE

Answer: Option B

Explanation: CREATE TABLE is used to define a new table structure.

13.) What is normalization in databases?

A) Increasing database size
B) Adding redundancy
C) Removing redundant data
D) Simplifying queries

Answer: Option C

Explanation: Normalization organizes data to reduce redundancy and improve efficiency.

14.) What does the JOIN clause do in SQL?

A) Combines data from multiple tables
B) Creates a new table
C) Deletes records
D) Updates records

Answer: Option A

Explanation: JOIN combines rows from two or more tables based on a related column.

15.) Which of the following is not a type of SQL join?

A) INNER JOIN
B) OUTER JOIN
C) CROSS JOIN
D) FULL JOIN

Answer: Option D

Explanation: FULL JOIN is not a valid SQL join type; FULL OUTER JOIN is the correct term.

16.) What is a composite key?

A) A single unique key
B) A combination of two or more columns as a key
C) A duplicate key
D) None of the above

Answer: Option B

Explanation: A composite key consists of two or more columns uniquely identifying a row.

17.) Which command is used to modify existing rows in a table?

A) INSERT
B) MODIFY
C) UPDATE
D) ALTER

Answer: Option C

Explanation: UPDATE modifies existing data in a table.

18.) What does ACID stand for in database transactions?

A) Atomicity, Consistency, Isolation, Durability
B) Accuracy, Connectivity, Integration, Durability
C) Atomicity, Clarity, Integrity, Dependability
D) None of the above

Answer: Option A

Explanation: ACID principles ensure reliable database transactions.

19.) What is a view in SQL?

A) A physical table
B) A virtual table based on a query
C) A key linking tables
D) None of the above

Answer: Option B

Explanation: A view is a virtual table created by a query.

20.) What is the default sorting order in SQL?

A) Ascending
B) Descending
C) Random
D) None

Answer: Option A

Explanation: SQL sorts data in ascending order by default.

Leave a Reply

Your email address will not be published. Required fields are marked *