1. Which SQL statement is used to retrieve data from adatabase?

A) GET
B) EXTRACT
C) SELECT
D) OPEN

Answer: C) SELECT


2. Which of the following SQL clauses is used to filterrecords?

A) WHERE
B) ORDER BY
C) GROUP BY
D) HAVING

Answer: A) WHERE


3. Which SQL function is used to count the number of rowsin a table?

A) COUNT()
B) SUM()
C) ROWS()
D) TOTAL()

Answer: A) COUNT()


4. What is the purpose of the GROUP BY clause in SQL?

A) To order data alphabetically
B) To group rows that have the same values in specified columns
C) To remove duplicates
D) To count rows in a table

Answer: B) To group rows that have the same values inspecified columns


5. Which of the following is a correct SQL statement toinsert data into a table?

A) INSERT INTO table_name VALUES ('value1', 'value2');
B) ADD INTO table_name VALUES ('value1', 'value2');
C) INSERT VALUE INTO table_name ('value1', 'value2');
D) PUT INTO table_name VALUES ('value1', 'value2');

Answer: A) INSERT INTO table_name VALUES ('value1','value2');


6. Which SQL clause is used to sort the result-set?

A) SORT BY
B) ORDER BY
C) GROUP BY
D) FILTER BY

Answer: B) ORDER BY


7. Which of the following SQL commands is used to removea table from the database?

A) DELETE TABLE
B) DROP TABLE
C) REMOVE TABLE
D) ERASE TABLE

Answer: B) DROP TABLE


8. What will the following SQL statement do?

Sql Query

 

SELECT * FROM Employees WHERE Salary > 5000;

A) It will select all employees with salary less than5000.
B) It will select employees with salary equal to 5000.
C) It will select all employees with salary greater than 5000.
D) It will delete employees with salary greater than 5000.

Answer: C) It will select all employees with salarygreater than 5000.


9. Which of the following SQL keywords is used to createa new table?

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

Answer: C) CREATE TABLE


10. Which operator is used to select values within aspecified range in SQL?

A) BETWEEN
B) IN
C) LIKE
D) WITHIN

Answer: A) BETWEEN

 

csdt centre