You are on page 1of 1

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

a) GET b) FETCH c)
SELECT d) READ
Answer: c) SELECT
2. What does the SQL WHERE clause do? a) Specifies the order of the result set b) Filters
rows based on specified conditions c) Groups rows that have the same values d) Joins
two or more tables
Answer: b) Filters rows based on specified conditions
3. Which SQL keyword is used to sort the result set in ascending order? a) ASC b) DESC c)
SORT d) ORDER
Answer: a) ASC
4. Which SQL command is used to make changes to an existing table structure? a) UPDATE
b) ALTER c) MODIFY d) CHANGE
Answer: b) ALTER
5. Which SQL function is used to count the number of rows in a result set? a) TOTAL() b)
COUNT() c) SUM() d) NUMROWS()
Answer: b) COUNT()
6. Which SQL statement is used to remove all records from a table? a) TRUNCATE b)
DELETE c) REMOVE d) DROP
Answer: a) TRUNCATE
7. What is the purpose of the SQL GROUP BY clause? a) To filter rows based on conditions
b) To sort the result set c) To group rows that have the same values into summary rows
d) To join tables
Answer: c) To group rows that have the same values into summary rows
8. Which SQL keyword is used to retrieve unique rows from a result set? a) DISTINCT b)
UNIQUE c) DIFFERENT d) EXCLUSIVE
Answer: a) DISTINCT
9. What does the SQL JOIN clause do? a) Adds new records to a table b) Deletes records
from a table c) Combines rows from two or more tables based on a related column d)
Updates existing records in a table
Answer: c) Combines rows from two or more tables based on a related column
10. Which SQL data type is used to store variable-length character strings? a) CHAR b)
VARCHAR c) TEXT d) STRING
Answer: b) VARCHAR

You might also like