• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 36 pages
Exam (elaborations)

D427 - Data Management Applications UPDATED ACTUAL Questions and CORRECT Answers

Document preview thumbnail
Preview 4 out of 36 pages

D427 - Data Management Applications UPDATED ACTUAL Questions and CORRECT Answers

Content preview

D427 - Data Management Applications UPDATED ACTUAL Questions and
CORRECT Answers

Lab 2.9 The Movie table has the following columns:
ID - integer, primary key
Title - variable-length string
SELECT Year, COUNT(*) AS TNMYear Genre - variable-length string
FROM Movie RatingCode - variable-length string
GROUP BY Year Year - integer
Write a SELECT statement to select the year and the total
number of movies for that year.
Hint: Use the COUNT() function and GROUP BY clause.
2.10 Lab - The Movie table has the following columns:
ID - integer, primary key
Title - variable-length string
Genre - variable-length string
RatingCode - variable-length string
SELECT mov.Title, mov.Year, rat.Description; Year - integer
FROM movie AS mov The Rating table has the following columns:
LEFT JOIN Rating AS rat Code - variable-length string, primary key
ON mov.RatingCode=rat.Code Description - variable-length string
Write a SELECT statement to select the Title, Year, and
rating Description. Display all movies, whether or not a
RatingCode is available.
Hint: Perform a LEFT JOIN on the Movie and Rating tables,
matching the RatingCode and Code columns.

2.11 Lab - Select employees and managers with inner
join
SELECT E.FirstName AS Employee, D.FirstName AS Man- The Employee table has the following columns:
ager ID - integer, primary key
FROM Employee AS L
FirstName - variable-length string
LastName - variable-length string

,ManagerID - integer






, Write a SELECT statement to show a list of all employ-
ees' first names and their managers' first names. List
INNER JOIN Employee AS D
only employees that have a manager. Order the results
ON E.ManagerID=D.ID
by Employee first name. Use aliases to give the result
WHERE E.ManagerID IS NOT NULL
columns distinctly different names, like "Employee" and
ORDER BY E.FirstName
"Manager".

Hint: Join the Employee table to itself using INNER JOIN.
2.12 Lab - Select lesson schedule with inner join
The database has three tables for tracking horse-riding
lessons:
1. Horse with columns:
o ID - primary key
o RegisteredName
o Breed
o Height
SELECT LessonDateTime, HorseID, FirstName, LastName o BirthDate
FROM LessonSchedule 2. Student with columns:
LEFT JOIN Student ON LessonSchedule.StudentID=Stu- o ID - primary key
dent.ID o FirstName
LEFT JOIN Horse ON LessonSchedule.HorseID=HorseID o LastName
WHERE Student.ID IS NOT NULL o Street
ORDER BY LessonDateTime, ASC, HorseID ASC o City
o State
o Zip
o Phone
o EmailAddress
3. LessonSchedule with columns:
o HorseID - partial primary key, foreign key references
Horse(ID)
o StudentID - foreign key references Student(ID)


, o LessonDateTime - partial primary key
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.
Hint: Perform a join on the Student and LessonSchedule
tables, matching the student IDs.

2.13 Lab - Select lesson schedule with multiple joins
1. Horse with columns:
o ID - primary key
o RegisteredName
o Breed
o Height
o BirthDate
2. Student with columns:
SELECT LessonDateTime, FirstName, LastName, Regis-
o ID - primary key
teredName
o FirstName
FROM LessonSchedule
o LastName
LEFT JOIN Student ON LessonSchedule.StudentID = Stu-
o Street
dent.ID
o City
LEFT JOIN Horse ON LessonSchedule.HorseID=Horse.ID
o State
WHERE DATE(LessonDateTime) = '202-02-01'
o Zip
ORDER BY LessonDateTime ASC, RegisteredName ASC
o Phone
o EmailAddress
3. LessonSchedule with columns:
o HorseID - partial primary key, foreign key references
Horse(ID)
o StudentID - foreign key references Student(ID)
o LessonDateTime - partial primary key

Document information

Uploaded on
September 30, 2025
Number of pages
36
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
R256,14

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
STANFORDGRADESS
4,0
(240)
Sold
1646
Followers
108
Items
119944
Last sold
2 hours ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions