Question
Consider the following relational schema, referential integrity constraints, and the database state. Write SQL DDL statements to define the database and DML statements to populate
Consider the following relational schema, referential integrity constraints, and the database state. Write SQL DDL statements to define the database and DML statements to populate the database. Make any other reasonable assumptions (e.g. for domains/data-types).
Primary Keys:
STUDENT Student_number
COURSE Course_number
PREREQUISITE - Course_number, Prerequisite_number
SECTION Section_identifier
GRADE_REPORT - Student_number, Section_identifier
The following referential integrity constraints should hold (we use the notation:
R.(A1, ..., An) --> S.(B1, ..., Bn)
to represent a foreign key from the attributes A1, ..., An of R (the referencing relation)
to S (the referenced relation)):
PREREQUISITE.(CourseNumber) --> COURSE.(CourseNumber)
PREREQUISITE.(PrerequisiteNumber) --> COURSE.(CourseNumber)
SECTION.(CourseNumber) --> COURSE.(CourseNumber)
GRADE_REPORT.(StudentNumber) --> STUDENT.(StudentNumber)
GRADE_REPORT.(SectionIdentifier) --> SECTION.(SectionIdentifier)
Specify the following queries in SQL on the above database schema.
Retrieve the names of all senior students majoring in CS (computer science).
Retrieve the names of all courses taught by Professor King in 2007 and 2008.
For each section taught by Professor King, retrieve the course number, semester, year, and number of students who took the section.
Retrieve the name and transcript of each senior student (Class = 4) majoring in CS.A transcript includes course name, course number, credit hours, semester, year, and grade for each course completed by the student.
Show work in Oracle SQL developer
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started