Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The database has three tables for tracking horse-riding lessons: 1. Horse with columns: - ID - primary key - RegisteredName - Breed - Height -

image text in transcribedimage text in transcribed

The database has three tables for tracking horse-riding lessons: 1. Horse with columns: - ID - primary key - RegisteredName - Breed - Height - BirthDate 2. Student with columns: - ID - primary key - FirstName - LastName - Street - City - State - Zip - Phone - EmailAddress 3. LessonSchedule with columns: - HorselD - partial primary key, foreign key references Horse(ID) - StudentID - foreign key references Student(ID) - 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. Main.sql Load default template... 1 SELECT ls. LessonDateTime, CONCAT(s. FirstName, ' ', s. LastName), 2 h.RegisteredName 3 FROM HORSE h INNER JOIN LessonSchedule ls 4 ON h. HorseID = ls. ID 5 RIGHT JOIN Student s 6 ON Ls.StudentID = s. ID 7 WHERE ls.LessonDateTime = '2020-02-01' 8 ORDER BY ls. LessonDateTime, 9 h. RegisteredName

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions

Question

2. What factors infl uence our perceptions?

Answered: 1 week ago

Question

4. Does mind reading help or hinder communication?

Answered: 1 week ago