Answered step by step
Verified Expert Solution
Link Copied!

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 =3).
(c) List the detail of faculty members who taught only in room W202.
(d) For each level, print the level and total number of students belong to that level.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

calculate net operating working capital for 2 0 1 3

Answered: 1 week ago

Question

2. Describe how technology can impact intercultural interaction.

Answered: 1 week ago

Question

7. Define cultural space.

Answered: 1 week ago