0% found this document useful (0 votes)
12 views

SPP Assignment 2

Uploaded by

rrajsharma2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

SPP Assignment 2

Uploaded by

rrajsharma2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Name : Sanket Prakash Patil

MIS: 712452049
Branch: MTech – Data Science

Assignment 2: Aggregates and Nested Subqueries


Statement : Write the SQL queries using aggregates, grouping, ordering statements and nested
subqueries for given statements on given schema.

A. Intermediate SQL: Aggregates and grouping and ordering

The following questions are all based on the university schema


• Find the number of instructors who have never taught any course. If the result of your
query is empty, add the appropriate data (and include corresponding insert statements) to
ensure the result is not empty. NOTE: IN THE SUBMISSION FILE, PASTE DATA
INSERTED BELOW THIS STATEMENT AS A REMARK.
• Find the total capacity of every building in the university.

• Find all departments that have at least one instructor, and list the names of the
departments along with the number of instructors; order the result in descending order
of number of instructors.
• For each student, compute the total credits they have successfully completed, i.e. total
credits of courses they have taken, for which they have a non-null grade other than 'F'. Do
NOT use the tot_creids attribute of student.

B. Nested Subqueries : Write the following queries for university schema.


• Find the id and title of all courses which do not require any prerequisites.
• Find the names of students who have not taken any biology dept. courses.

You might also like