Computer Fundamentals for Placements – SQL MCQs with Answers

Q. 1 Which SQL command is used to extract data from a database?
Check Solution

Ans: B

The SELECT statement is the fundamental command used in SQL to retrieve or extract data from a database table.

Q. 2 Which of the following SQL clauses is used to filter records based on a specified condition?
Check Solution

Ans: C

The WHERE clause is used to filter records and extract only those that fulfill a specified condition.

Q. 3 What is the purpose of the JOIN clause in SQL?
Check Solution

Ans: A

The JOIN clause is used to combine rows from two or more tables based on a related column between them, allowing you to query data across multiple tables.

Q. 4 Which SQL keyword is used to sort the result set in ascending or descending order?
Check Solution

Ans: C

The ORDER BY clause is used to sort the result set in either ascending (ASC) or descending (DESC) order.

Q. 5 Which command is used to add a new record to a database table?
Check Solution

Ans: B

The INSERT INTO command is used to add new rows or records to a database table.

Q. 6 What does PRIMARY KEY constraint in a table ensure?
Check Solution

Ans: B

A PRIMARY KEY is a field or a combination of fields that uniquely identifies each record in a database table. It must contain unique and non-null values.

Q. 7 Which of the following is a Data Definition Language (DDL) command?
Check Solution

Ans: D

DDL (Data Definition Language) commands are used to define or modify the structure of a database. CREATE TABLE is a DDL command, while SELECT, INSERT, and UPDATE are part of DML (Data Manipulation Language).

Q. 8 What is the purpose of the GROUP BY clause?
Check Solution

Ans: B

The GROUP BY statement groups rows that have the same values into summary rows, often with aggregate functions like COUNT(), MAX(), MIN(), SUM(), or AVG().

Q. 9 Which SQL statement is used to delete existing records in a table?
Check Solution

Ans: B

The DELETE statement is used to remove one or more existing rows from a table. DROP is used to delete an entire table or database object, and TRUNCATE removes all rows from a table, but the table structure remains.

Q. 10 What is the correct syntax to retrieve a list of unique values from a column?
Check Solution

Ans: A

The DISTINCT keyword is used in a SELECT statement to return only unique (non-duplicate) values in a specified column.

Next Topic: Pseudocode Questions for Placements

Practice Aptitude Questions for Placements

Crack Placement Tests: Faster & Smarter

Adaptive Practice | Real Time Insights | Resume your Progress

Try a better way to Practice? Yes No
Scroll to Top