Test Your Knowledge

SQL Server Quiz

Answer all questions to test your understanding

1 What is SSMS used for?
2 What is the purpose of Object Explorer in SSMS?
3 What command checks the SQL Server version?
4 What shortcut runs a query in SSMS?
5 Which databases are system databases in SQL Server?
6 What command creates a new database?
7 What does IDENTITY(1,1) do in a table definition?
8 What is the purpose of a PRIMARY KEY?
9 What does NOT NULL mean in SQL?
10 What command shows the structure of a table?
11 What does UNIQUE do in SQL?
12 Which data type is used for whole numbers?
13 Which data type is used for text with variable length?
14 Which data type is used for money/decimal values?
15 What is the purpose of a CHECK constraint?
16 What is the purpose of a FOREIGN KEY constraint?
17 What is DECIMAL(10,2) used for?
18 What does SELECT * FROM Students do?
19 What is the purpose of WHERE in SQL?
20 What does ORDER BY do?
21 What does ORDER BY LastName DESC do?
22 Which clause filters rows based on a condition?
23 What does INNER JOIN do?
24 What does LEFT JOIN do?
25 When should you use LEFT JOIN?
26 What is the difference between INNER JOIN and LEFT JOIN?
27 Which join returns all rows from both tables, matched where possible?
28 What does INSERT do?
29 What does UPDATE do?
30 What does DELETE do?
31 What is the most important rule for UPDATE and DELETE?
32 How can you safely test a DELETE statement?
33 What is a stored procedure?
34 Why use stored procedures?
35 How do you call a stored procedure?
36 What command creates a stored procedure?
37 How do stored procedures prevent SQL injection?
38 What is a scalar function?
39 What is a view in SQL Server?
40 What is a table-valued function?
41 Can you use WHERE on a view?
42 What is the difference between a view and a table?
43 What is the purpose of an index?
44 What is the downside of having too many indexes?
45 Which columns should you index?
46 What is a composite index?
47 Does a PRIMARY KEY have an index automatically?
48 What is a transaction?
49 What does COMMIT do?
50 What does ROLLBACK do?
51 What does the 'A' in ACID stand for?
52 What does the 'D' in ACID stand for?
53 What should you use to handle errors in a transaction?