Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following relations: Student (snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets_at: string, room: string, fid: integer) Enrolled

 

Consider the following relations: Student (snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets_at: string, room: string, fid: integer) Enrolled (snum: integer, ename: string) Faculty (fid: integer, fname: string, deptid: integer) Write the following queries in SQL. 1. Find the names of the students that are enrolled in all the classes. 2. Find the names of the classes and their designated rooms that have five or more students enrolled. 3. Find the names of students who are enrolled in the course called Math101. 4. Find the names of the faculty members who do not teach any class. 5. Find the name of classes in which only students of the first year are enrolled.

Step by Step Solution

3.44 Rating (147 Votes )

There are 3 Steps involved in it

Step: 1

1 SELECT DISTINCT sname FROM Student WHERE snum IN S... 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

Database management systems

Authors: Raghu Ramakrishan, Johannes Gehrke, Scott Selikoff

3rd edition

72465638, 978-0072465631

More Books

Students also viewed these Programming questions