Question: Write the query in SQL For (g) Only I only want the answer for (g) 1. The university database has the following schema. This is

Write the query in SQL
For (g) Only
I only want the answer for (g)  Write the query in SQL For (g) Only I only want

1. The university database has the following schema. This is intended to be used for a single year and semester. Primary keys are underlined. The relationships between tables are as you know. STUDENT(SSN, SNAME, MAJOR, DOB, ADDRESS) COURSE (CID, CNAME, CREDIT) ENROLLED (SSN, CID, GRADE FACULTY (SSN, NAME, DOB) TEACHING (FACULTYSSN, CID) PREQ(CID, PREREQUISITECID, PASSINGGRADE) Write each query in SQL: (a) (8 points) What are the names of students who enrolled in a course without enrolling in that course's prerequisite? (b) (5 points) What is the most popular major? (c) (5 points) Retrieve a summary: for each prerequisite course id, show the number of courses that require it as a prerequisite course. (d) (6 points) What are the names of courses that have at least two prerequisites? (e) (6 points) What are the names of courses that have less than five students enrolled in? (f) (8 points) What are the names of faculties who teach a course and also its prerequisite course? (g) (10 points) Write a series of SQL statements for creating the university database completely. Each statement ends with a semicolon. The statements need to be in a proper order, so that the foreign key referent exists before the foreign key declaration. Please use appropriate data types

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!