Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following relational schema: Department (deptid, dname, location) Student (snum, sname, deptid, age) Faculty(fid, fname, deptid) Class(cname, deptid, meets at, room, faculty) Enrolled(snum, cname,

image text in transcribed
Consider the following relational schema: Department (deptid, dname, location) Student (snum, sname, deptid, age) Faculty(fid, fname, deptid) Class(cname, deptid, meets at, room, faculty) Enrolled(snum, cname, score, grade) Assume that: All students and faculty members must major/work in one department; - Faculty teach courses only in the department they belong to: - The names of the courses are unique for each department - Scores are numbers in [0,100]; - Faculty in Table Class is a subset of fid in Table Faculty. Write each of the following queries using Query-by Example (QBE). If you believe any one of the following is not expressible in QBE, informally explain why it cannot be expressed. 4. (10 pts) Print the names of the students who are enrolled in the most number of courses. 5. (10 pts) Print the student ids with the maximum average score in the courses they have enrolled in. 6. (5 pts) Delete the departments that do not have any faculty or courses at all

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

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions