Three.10 LAB - Select variety of movies grouped by using yr - ANSSELECT Year, COUNT(*)
AS Total_Movies
FROM Movie
GROUP BY Year;
three.Eleven LAB - Select film ratings with left be part of - ANSSELECT Movie.Title,
Movie.Year, Rating.Description
FROM Movie
LEFT JOIN Rating ON Movie.RatingCode = Rating.Code;
three.12 LAB - Select employees and executives with internal be part of - ANSSELECT
E.FirstName AS Employee, M.FirstName AS Manager
FROM Employee E
INNER JOIN Employee M ON E.ManagerID = M.ID
ORDER BY E.FirstName;
three.Thirteen LAB - Select lesson schedule with inner be part of - ANSSELECT
LessonSchedule.LessonDateTime, LessonSchedule.HorseID, Student.FirstName,
Student.LastName
FROM LessonSchedule
INNER JOIN Student ON LessonSchedule.StudentID = Student.ID
WHERE LessonSchedule.StudentID IS NOT NULL
ORDER BY LessonSchedule.LessonDateTime ASC, LessonSchedule.HorseID ASC;
3.14 LAB - Select lesson agenda with more than one joins - ANSSELECT LessonDateTime,
FirstName, LastName, RegisteredName
FROM LessonSchedule
LEFT JOIN Student ON LessonSchedule.StudentID = Student.ID
LEFT JOIN Horse ON LessonSchedule.HorseID = Horse.ID
WHERE DATE(LessonDateTime) = '2020-02-01'
ORDER BY LessonDateTime ASC, RegisteredName ASC;
three.15 LAB - Select tall horses with subquery - ANSSELECT RegisteredName, Height
FROM Horse
WHERE Height > (
SELECT AVG(Height)
FROM Horse
)
ORDER BY Height ASC;
3.Sixteen LAB - Multiple joins with combination (Sakila) - ANSSELECT a.Last_name,
a.First_name, ROUND(AVG(f.Period), zero) AS common