The analysis in Question 2 results in the following schema, which Ferngate Leisure Centre has now implemented (primary keys marked [PK], foreign keys marked [FK]):
Member(MemberID [PK], FirstName, LastName, DateOfBirth, JoinDate, MembershipType)
Instructor(InstructorID [PK], FirstName, LastName, Speciality, ContactNumber)
FitnessClass(ClassID [PK], ClassName, InstructorID [FK], DayOfWeek, StartTime, DurationMins, MaxCapacity)
Booking(BookingID [PK], MemberID [FK], ClassID [FK], BookingDate, Attended)
FitnessClass.InstructorID references Instructor.InstructorID. Booking.MemberID references Member.MemberID and Booking.ClassID references FitnessClass.ClassID. Attended holds the text 'Yes' or 'No'. Refer to this schema for every remaining question in this pack unless stated otherwise.
Write an SQL statement for each of the following.
(a)List the FirstName and LastName of every member whose MembershipType is 'Premium'.(2)
(b)List the ClassName and DayOfWeek of every fitness class, sorted alphabetically by ClassName.(2)
(c)Count how many bookings have been made for the class with ClassID 5.(2)
(d)Display each distinct MembershipType currently held by members, with no duplicates in the result.(2)
(e)List the LastName of every instructor whose Speciality contains the word 'Yoga' anywhere within it.(2)
(Total for Question 3 is 10 marks)