

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Main points of this past exam are: Relational Database, Integrity Constraints, Definition, Largest Number, Students, Equivalent Query, Base Tables, Underlying Base Tables, Modified, Associated Stored Procedures
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!
Suppose there are two relations A (a1, a2, a3) and B (b1, b2, b3). A has two candidate keys and its primary key is (a1, a2). B has only one candidate key and its primary key is (b2, b3). How many candidate keys will the relation A times B have? How many primary keys will the relation A times B have? Please state your reasoning in support of your conclusion.
Express in relational algebra the names of the EECS students who are taking any EECS courses.
Express in relational calculus the names of the departments which either have no students or have at least one student taking each EECS course.
CS 186MIDTERMFALL 1994professor (e.g., Professor J. Wawrzynek) 1
Express in SQL the names and department names of the students who are from departments not located in Evans Hall.
Express in SQL the names of the students who are not taking any EECS courses.
Express in SQL the names of the departments which have the largest number of students taking EECS courses.
Suppose we have the following view definition in the database for all CS students:
create view cs_student as select s.name, s.regno, s.gpa, s.level from STUDENT s where s.dept = 'CS'
Suppose we have the following INGRES table level integrity constraints: create integrity on STUDENT is gpa > 0
Usually the DBMS query modifier converts a query involving views into an equivalent query on the underlying base tables. The query is then modified according to the table level integrity constraints existing on the base tables.
Modify the following query according to the view definition and table level integrity constraint defined above: update cs_student set gpa = gpa - 1. where level = 4
Write the rules (and the associated stored procedures) to enforce the integrity constraint: No students can take more than 3 courses from the same department. You may assume that the department of a course will nver change.
Problem #4 2