Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the query in SQL What are the answers for the parts d,e,f,g? The university database has the following schema. This is intended to be

Write the query in SQL
What are the answers for the parts d,e,f,g? image text in transcribed
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) What are the names of students who enrolled in a course without enrolling in that course's prerequisite? (b) What is the most popular major? (c) Retrieve a summary: for each prerequisite course id, show the number of courses that require it as a prerequisite course. (d) What are the names of courses that have at least two prerequisites? (e) What are the names of courses that have less than five students enrolled in? (f) What are the names of faculties who teach a course and also its prerequisite course? (g) 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

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

1. Design an effective socialization program for employees.

Answered: 1 week ago