Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following relational schema: Student ( snum , fname, sname, major, level, age ) Class ( cid cname meets, at room, fid ) Enrolled
Consider the following relational schema:
Student snum fname, sname, major, level, age
Class cid cname meets, at room, fid
Enrolled snum cid
Faculty fid fname sname, deptname
Primary keys are underlined, and foreign keys are highlighted in red. Write SQL queries to answer the following:
a Write SQL to create Student, Class, Faculty, and Enrolled tables from the relational schema provided above. Select appropriate data types for each attribute. Also remember to set primary and foreign keys.
b Find fname sname, and major of all students who are seniors level
c List the detail of faculty members who taught only in room W
d For each level, print the level and total number of students belong to that level.
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