WGU D427 DATABASE MANAGEMENT
FINAL SCRIPT 2026 QUESTIONS WITH
ANSWERS GRADED A+
◉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;
,◉Write a SELECT statement to create a lesson schedule with the
lesson date/time, horse ID, and the student's first and last names.
Order the results in ascending order by lesson date/time, then by
horse ID. Unassigned lesson times (student ID is NULL) should not
appear in the schedule.
Horse with columns:
ID - primary key
RegisteredName
Breed
Height
BirthDate
Student with columns:
ID - primary key
FirstName
LastName
Street
City
State
Zip
,Phone
EmailAddress
LessonSchedule with columns:
HorseID - partial primary key, foreign key references Horse(ID)
StudentID - foreign key references Student(ID)
LessonDateTime - partial primary key. Answer: SELECT
LessonDateTime, HorseID, FirstName, LastName
FROM lessonschedule
INNER JOIN student
ON studentid = id
ORDER BY lessondatetime, horseid ASC;
◉Write a SELECT statement to create a lesson schedule for Feb 1,
2020 with the lesson date/time, student's first and last names, and
the horse's registered name. Order the results in ascending order by
lesson date/time, then by the horse's registered name. Make sure
unassigned lesson times (student ID is NULL) appear in the results.
Horse with columns:
ID - primary key
RegisteredName
, Breed
Height
BirthDate
Student with columns:
ID - primary key
FirstName
LastName
Street
City
State
Zip
Phone
EmailAddress
LessonSchedule with columns:
HorseID - partial primary key, foreign key references Horse(ID)
StudentID - foreign key references Student(ID)
FINAL SCRIPT 2026 QUESTIONS WITH
ANSWERS GRADED A+
◉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;
,◉Write a SELECT statement to create a lesson schedule with the
lesson date/time, horse ID, and the student's first and last names.
Order the results in ascending order by lesson date/time, then by
horse ID. Unassigned lesson times (student ID is NULL) should not
appear in the schedule.
Horse with columns:
ID - primary key
RegisteredName
Breed
Height
BirthDate
Student with columns:
ID - primary key
FirstName
LastName
Street
City
State
Zip
,Phone
EmailAddress
LessonSchedule with columns:
HorseID - partial primary key, foreign key references Horse(ID)
StudentID - foreign key references Student(ID)
LessonDateTime - partial primary key. Answer: SELECT
LessonDateTime, HorseID, FirstName, LastName
FROM lessonschedule
INNER JOIN student
ON studentid = id
ORDER BY lessondatetime, horseid ASC;
◉Write a SELECT statement to create a lesson schedule for Feb 1,
2020 with the lesson date/time, student's first and last names, and
the horse's registered name. Order the results in ascending order by
lesson date/time, then by the horse's registered name. Make sure
unassigned lesson times (student ID is NULL) appear in the results.
Horse with columns:
ID - primary key
RegisteredName
, Breed
Height
BirthDate
Student with columns:
ID - primary key
FirstName
LastName
Street
City
State
Zip
Phone
EmailAddress
LessonSchedule with columns:
HorseID - partial primary key, foreign key references Horse(ID)
StudentID - foreign key references Student(ID)