flyingpuma.com

SQL Query Essentials Exam

SQL Query Essentials Course Exam

1. True or False:
SQL queries are written in plain text.

 
 

2. SQL is an acronym for:

 
 
 
 

3. The process of structuring data into related tables to reduce data redundancy is called:

 
 
 
 

4. In Microsoft SQL Server Management Studio a query is executed by:

 
 
 
 
 
 

5. True or false:
The only way to indicate what database is used in Microsoft SQL Server Managment Studio is the “USE” statement.

 
 

6. Which SQL statement is used to indicate what fields or columns should be included in the query results:

 
 
 
 

7. Which SQL statement is used to indicate which table(s) will be used to retrieve data?

 
 
 
 

8. Which SQL statement is used to indicate selection criteria in a query?

 
 
 
 

9. True or false:
Parentheses cannot be used in the WHERE clause of a query to group criteria that contain “AND” and “OR”.

 
 

10. True or false:
The BEWTEEN operator includes the lower and upper values in the result set if the values are present in the data.

 
 

11. Which of these statements is a valid WHERE clause in a query?

 
 
 
 
 

12. Which of these statements is a valid WHERE clause in a query?

 
 
 
 

13. Which of the following WHERE clauses will return results with only last names that start with the letter J?

 
 
 
 
 

14. Which of these statements is a valid WHERE clause in a query (datefield represents a column stored as DATE)?

 
 
 
 

15. Which of these statements will limit the query results to 5 rows of data in Microsoft SQL Server?

 
 
 
 

16. Which of the following can be used to create a comment in SQL?

 
 
 
 
 

17. True or false:
A comment that starts with – – (two dashes) can extend to multiple lines.

 
 

18. True or false:
An Inner Join must include the word “Inner” when used in SQL.

 
 

19. Which statement is true about Inner Joins?

 
 
 
 

20. True or false:
A Left Outer Join must include the word “Outer” when used in SQL.

 
 

21. Which statement is true about Left Outer Joins?

 
 
 
 

22. True or false:
A Full Outer Join must include the word “Outer” when used in SQL.

 
 

23. Which statement is true about Full Outer Joins?

 
 
 
 

24. True or false:
It is a best practice to use table aliases when a query uses data from more than one table.

 
 

25. True or false:
It is necessary to use the word “As” when creating a table alias in SQL.

 
 

26. Which of the following are part of best practices when writing queries in SQL?

 
 
 
 
 

27. Which of the following methods can eliminate duplicate data rows in a result set?

 
 
 
 
 
 

28. Which of the following is not an aggregate function included in SQL?

 
 
 
 
 

29. True or false:
The COUNT function counts all rows of a specified field in a result set even if that field contains NULLS in the result set.

 
 

30. True or false:
The HAVING clause must come before the GROUP BY clause in an SQL query.

 
 

31. Which statement is true regarding the HAVING clause?

 
 
 
 

32. True or false:
The order of results cannot be controlled in SQL.

 
 

33. True or false:
The ORDER BY statement can only order results based on values in one column.

 
 

34. True or false:
The ORDER BY statement can only order results in ascending order.

 
 

35. Which of the following is a valid ORDER BY statement?

 
 
 
 
 
 
 

36. Which of the following can evaluate if a field is null and return a supplied value if it is null?

 
 
 
 
 

37. Which of the following is a valid CASE statement?

 
 
 
 

38. True or false:
The CASE statement must always include an ELSE clause.

 
 

39. True or false:
SQL Server Management Studio cannot save query results in a pipe delimited format.

 
 

40. True or false:
SQL Server Management Studio places quotes around text fields when exporting to a csv file by default.

 
 

41. Which of the following criteria will exclude both Smith and Jones from the results?

 
 
 
 
 
 

42. Which of the following will count the number of unique last names in the Employees table?

 
 
 
 

43. Which of the following criteria will limit the results to only include last names of Jones, Miller, and Smith?

 
 
 
 
 

44. Which of the following criteria will return all work dates in calendar year 2016?  (WorkDate is stored as DATE)

 
 
 
 

45. Which of the following will return the total hours worked for each employee ID?

 
 
 
 

46. What type of join is the following statement?

JOIN OfficeLocations ON Employees.LocationID=OfficeLocations.LocationID
 
 
 
 

47. True or false:
The following is a valid SQL query:

	SELECT 
		EmployeeID,
		CASE WHEN StartDate >= '2016-01-01'
		     THEN 'After Merger'
		     ELSE 'Before Merger'  
		     AS StartIndicator
	FROM Employees
 
 

48. True or false:
The following is a valid SQL query:

	SELECT 
		EmployeeID
		FirstName
		LastName
	FROM Employees
 
 

49. True or false:
The following is a valid SQL query:

	SELECT
		FirstName,
		LastName
	FROM Employees
	ORDER BY LastName, FirstName
 
 

50. Which of the following are optional sections in a SELECT query:

 
 
 
 

Question 1 of 50