Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A ) Consider the relational database described below, primary keys are underlined ( 2 5 points ) Student ( snum: integer, sname: string, major: string,
A Consider the relational database described below, primary keys are underlined points
Student snum: integer, sname: string, major: string, level: string, age: integer
Class name: string, meets at: string, room: string, fid: integer
Enrolled snum: integer, cname: string
Faculty fid: integer, fname: string, deptid: integer
Consider following database instances:
Student
tablesnumsname,major,level,ageHelen,CSJRCharles,CSSRAndy,CSGRBob,CSSRZorba,CSGR
tableEnrolledsnulcnameCSCCSCECECSCECE CSCCSCECE
Class
tablenamemeetsatroom,fidCSCWBACSCTBAECEMBAECEFBACSCRBA
Faculty
tablefidfname,deptidS Jackson,
Write the following queries in SQL No duplicates should be printed in any of the answers.
Find the names of all Juniors level who are enrolled in a class taught by I. Teach.
For each level, print the level and the average age of students for that level.
For all levels except JR print the level and the average age of students for that level.
Find the names of students enrolled in the maximum number of classes.
Find the names of faculty members for whom the combined enrollment of the courses that they teach is less than five.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started