Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the following queries in SQL. We do not care if your answer contains duplicate rows or not, unless we specify otherwise. The use of

image text in transcribed

Write the following queries in SQL. We do not care if your answer contains duplicate rows or not, unless we specify otherwise. The use of temporary tables is not allowed for any query.

image text in transcribed

- student(sid, sname, sex, age, year, gpa) [Year is a number between 1 and 5]. - dept(dname,numphds) - prof(pname, dname) - course(cno, cname, dname) [Course numbers are unique within departments.] - major(dname, sid) - section(dname, cno, sectno, pname) [Associates an instructor to a section.] - enroll(sid, grade, dname, cno, sectno) [Associates students to sections.] c. For each professor, calculate the average grade G of all students taught by that professor; for professors with a G value of at least 2.5, print the professor's name, department, total enrollment and average grade (i.e., G). Assume that the enrollment of a professor is the sum of the enrollment of all his/her sections. d. For each department, show information about the student(s) with the highest gpa who major in the department. In particular, for each such student, we want to show the student id, student name and gpa, the department name the student is major in, and the total number of classes that the student took. If there are ties, show all students with that gpa

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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

Question Can life insurance be used in a Keogh (HR 10) plan?

Answered: 1 week ago