APPLICATIONS FINAL STUDY GUIDE
2026 COMPLETE QUESTIONS AND
ANSWERS.
List the next five Pixar movies sorted alphabetically
Movies Table:
Id
Title
Director
Year
Length_minutes. Answer: SELECT title
FROM movies
ORDER BY title ASC
LIMIT 5 OFFSET 5;
List all buildings and the distinct employee roles in each building
(including empty buildings)
Buildings Table:
Building_name, Capacity
,Employees Table:
Role, Name, Building, Years_employed. Answer: SELECT
DISTINCT building_name, role
FROM buildings
LEFT JOIN employees
ON building_name = building;
Find the name and role of all employees who have not been
assigned to a building
Buildings Table:
Building_name, Capacity
Employees Table:
Role, Name, Building, Years_employed. Answer: SELECT name,
role FROM employees
WHERE building IS NULL;
Find the names of the buildings that hold no employees
Buildings Table:
Building_name, Capacity
Employees Table:
Role, Name, Building, Years_employed. Answer: SELECT
DISTINCT building_name
,FROM buildings
LEFT JOIN employees
ON building_name = building
WHERE role IS NULL;
Select the number of movies grouped by year
The Movie table has the following columns:
ID - integer, primary key
Title - variable-length string
Genre - variable-length string
RatingCode - variable-length string
Year - integer. Answer: SELECT count(title), year
FROM movie
GROUP BY year;
Write a SELECT statement to select the Title, Year, and rating
Description. Display all movies, whether or not a RatingCode is
available.
Movie Table:
ID - integer, primary key
Title - variable-length string
Genre - variable-length string
RatingCode - variable-length string
, Year - integer
Rating Table:
Code - variable-length string, primary key
Description - variable-length string. Answer: SELECT title, year,
description
FROM movie
LEFT JOIN rating
ON ratingcode = code;
Write a SELECT statement to show a list of all employees' first
names and their managers' first names. List only employees that have
a manager. Order the results by Employee first name. Use aliases to
give the result columns distinctly different names, like "Employee"
and "Manager".
The Employee table has the following columns:
ID - integer, primary key
FirstName - variable-length string
LastName - variable-length string
ManagerID - integer. Answer: SELECT DISTINCT m.firstname as
employee, e.firstname as manager
FROM employee AS e
INNER JOIN employee AS m
ON e.id = m.managerid
ORDER BY m.firstname ASC;