You have been given the following specifications of a simple database for keeping track of exercise sessions and their instructors at a fitness centre (note that primary keys are shown underlined, foreign keys in bold).

You should run your SQL to demonstrate that it works correctly, and paste in the statements used plus the output from Oracle.

INSTRUCTOR (InstructorName, InstructorEmail, Biography, Specialty)

SESSIONS (SessionID, DayAndTime, NumberOfPlaces, ClassName, VenueName, InstructorName)

a. Give the SQL to create the INSTRUCTOR table. Choose appropriate data types. None of the attributes should be allowed to be null. Include the primary key constraint.

b. Give the SQL to create the SESSIONS table. Use appropriate data types, and include the primary key and foreign key constraints. Referential integrity should be set such that if an Instructor is deleted from the database, any sessions that she or he is running will also be deleted.

c. Give the SQL to add your own record to the INSTRUCTOR table. Include your name and email, and make up appropriate entries for your Biography and Specialty.

d. Give the SQL to create a constraint to the SESSIONS table to restrict the possible venues to the following 5: Main Group Fitness Studio, Indoor Cycle Studio, Mind and Body Studio, 25m Lap Pool, Warm Water Pool.

e. Give the SQL to record the fact that all the sessions of the GymFit class have increased their number of places by 5. (Note: you don’t need to add any actual data to run the query, although you may do so if you wish.)

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"