12.g.    Get a list of all classes and the department which offered them, listed by department name, professor name, course name, and class name, where enrollment has been greater than 54, ordered by department name, professor name, course name, class ID, and enrollment.

 

Commands

Output

Select dept_name, prof_name,

          course_name,

          classes.class_id,

          enrollment

From department, professors, courses,

         teach, classes

Where

    department.dept_id = professors.dept_id

And professors.prof_id = teach.prof_id

and teach.course_id = courses.course_id

and courses.course_id = classes.course_id

and enrollment > 54

order by dept_name, prof_name,

         course_name,

         classes.class_id;

DEPT_NAME    PROF_NAME    COURSE_NAME    CLASS_ID     ENROL

Accounting      Adams              Intermed. Acct.      333-97862      76

Infosys             Kirs                  Database                 765-22290      68

Infosys             Kirs                  Database                 866-56721      58

Infosys             Kirs                  Database                 998-77211      56

Infosys             Mahapatra        COBOL                  661-56720      62

Infosys             Mahapatra        COBOL                  980-77852      85

Infosys             Mahapatra        Database                 765-22290      68

Infosys             Mahapatra        Database                 866-56721      58

Infosys             Mahapatra        Database                 998-77211      56

 

9 rows selected.