Question: Part 1 : University SQL ( 4 0 points ) Consider a database consisting of the following five tables. Attributes that are underlined have been
Part : University SQL points
Consider a database consisting of the following five tables. Attributes that are underlined have been
designated the primary key of their respective tables, and fields with identical names in different
tables can be safely assumed to be foreign keys. The Project Name and Course Name fields are
specified as UNIQUE, and all fields are required except for Major, which may be NULL undeclared
StudentsSID Name, Major
ProjectsPID PName
CoursesCID CName
MembersID SID
Enrollments SID
Write each of the following queries in a separate file named UniversityQueryNsql where N is
the number of the query as enumerated. Each query is worth points. Fields must be selected in
the order they are given at the beginning of each problem statement and results must be sorted as
specified at the end of each problem statement. We have not provided you with any sample data for
this part of the assignment, so it is suggested that you devise a way to test your scripts to ensure
that they are correct. There are no restrictions on the methods you use to complete the query:
nested queries, views, and set operations are all legal. In all instances, do not have duplicate rows
in your results.
Create a view called StudentPairs with two columns, SID and SID The contents of this view should be all pairs of SIDs of two students who are enrolled in at least one common class but are not already partners on any project. You should report each student pair exactly once. The lower ID should be SID and the higher ID should be SID The contents of the view do not need to be sorted, and you do not need to drop the view. You must NOT create views other than the StudentPairs view.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
