SQL Class Exercise: One-to-Many Database Querys

             
Objective: Use SQL to access data from a 1:M relational database. The
     University Database tables named Faculty and Course contain sample data.
0.  Create a database and define primary and foreign keys for Faculty and
    Course tables. 


1. Project and Restrict operations:
   a. Select the columns fName and office from the Faculty table.


   b. Select all columns from Course for rows where the fId = 533.



   c. List meetingTime, room, cTitle from Course in order by room within 
      meetingTime.



   d. Report Course count by Faculty.


   e. For each Faculty member, project fId, and the maximum fee charged for a 
      Course they are assigned to teach.



   f. Revise the 1e solution to limit the output to those Faculty members 
      teaching at least two Courses.



2. Multiple Relation Queries (subquery and join):
   a. Write a query with subquery (nested query) to list the titles of those
      Courses taught by 'Brown'.



   b. Rewrite the query for 2a using the correlative subquery approach.



   c. Prepare a join query to retrieve Course title, Faculty name, and 
      meetingTime for Courses taught in 'JO 129'.



3. Views:
   a. Create a view of Course data that projects fName, cTitle, and fee.
      Prepare a query of this view that restricts output to those Courses
      taught by 'Huerter'.




   b. Create a view of the view prepared for 3a to restrict output to those
      Courses taught by 'Huerter'.  Query this view.
      
      
   c. Issue show create view commands for views created in 3a and 3b.