SQL Mock Test

Note:- Read each question carefully and select the most appropriate answer. Complete the test within the allotted time and review your answers before submission. Once submitted, your score and correct answers will be displayed.

1. What is the purpose of a FOREIGN KEY?

 
 
 
 

2. Which command permanently saves the current transaction?

 
 
 
 

3. Which language is primarily used to query and manage data in Microsoft SQL Server?

 
 
 
 

4. Which aggregate function calculates the average of numeric values?

 
 
 
 

5. Which command deletes selected rows from a table?

 
 
 
 

6. Which join returns matching rows from both tables only?

 
 
 
 

7. Which clause is used to filter rows in a SELECT query?

 
 
 
 

8. Which keyword removes duplicate rows from query results?

 
 
 
 

9. Which SQL Server data type stores variable-length text?

 
 
 
 

10. Which command adds new rows to a table?

 
 
 
 

11. Which aggregate function counts rows?

 
 
 
 

12. Which clause sorts the result set?

 
 
 
 

13. Which statement changes a table’s structure?

 
 
 
 

14. Which data type can store TRUE/FALSE-like values as 0 or 1 in SQL Server?

 
 
 
 

15. Which constraint uniquely identifies each row in a table?

 
 
 
 

16. Which clause groups rows that share values for aggregate calculations?

 
 
 
 

17. Which clause filters grouped or aggregated results?

 
 
 
 

18. Which statement creates a new table?

 
 
 
 

19. Which join returns all rows from the left table and matching rows from the right table?

 
 
 
 

20. Which SQL statement is used to retrieve data from a table?

 
 
 
 

21. Which operator is used for pattern matching with wildcards?

 
 
 
 

22. Which data type is commonly used for whole numbers in SQL Server?

 
 
 
 

23. Which command modifies existing rows?

 
 
 
 

24. Which operator checks whether a value falls within a range?

 
 
 
 

25. Which function returns the current date and time in SQL Server?

 
 
 
 

Question 1 of 25