Final DB Systems Exam June 2020
Final DB Systems Exam June 2020
EXAMINATION PAPER
Lecturer name: Dr. Sherif Tawfik, Dr. Asser Hassan Exam Date: 20-6-2020
Registration #: ------------------------------------
Department: --------------------------------------
3- Application programs are responsible for creating, maintaining, and supporting database
backup and recovery systems.
6- Since surrogate keys are used to uniquely identify rows, their values are normally displayed
on all forms and reports for the users to see.
9- To force the DBMS to remove duplicate rows from the results of a SQL SELECT query,
the keyword DISTINCT must be used.
10- In SQL, to refer to a range in a WHERE clause, use the WITHIN keyword.
Try to map the relational schema of the following figure into an ER schema (ERD with resolved
relationships). This is part of a process known as reverse engineering, where a conceptual
schema is created for an existing implemented database. State any assumptions you make.
Subject Table
2 C++ C++Teacher
Score Table
1 10 1 70
2 10 2 75
3 11 1 80
In the Score table, we need to store some more information, which is the exam name and total
marks, so let's add 2 more columns to the Score table.
A) Normalize the following relation to get an equivalent schema in which all relations are
in 3NF.
B) What are the advantage of removing transitive dependency?
Question A:
Consider the following set of requirements for a UNIVERSITY database that is used to keep track of
students' transcripts.
Suppose you are designing a schema to record information about the team sports at AAST, e.g.
football, basketball, hockey, etc. Your database needs to record the following information:
• For each student, his/her student id, name, and address. A student may join different teams.
• For each team, its name, captain, ranking, and team members (including the captain).
• For each game, its host team, guest team, date, and score.
(a) The university keeps track of each student's name, student number, social security number,
current address and phone, permanent address and phone, birthdate, sex, class (freshman,
sophomore, ..., graduate), major department, minor department (if any), and degree program
(B.A., B.S., ..., Ph.D.). Some user applications need to refer to the city, state, and zip of the
student's permanent address, and to the student's last name. Both social security number and
student number have unique values for each student.
(b) Each department is described by a name, department code, office number, office phone,
and college. Both name and code have unique values for each department.
(c) Each course has a course name, description, course number, number of semester hours,
level, and offering department. The value of course number is unique for each course.
(d) Each section has an instructor, semester, year, course, and section number. The section
number distinguishes different sections of the same course that are taught during the same
semester/year; its values are 1, 2, 3, ..., up to the number of sections taught during each
semester.
(e) A grade report has a student, section, letter grade, and numeric grade (0, 1, 2, 3,4 for F, D,
C, B, A, respectively).
Design an ER schema for this application, and draw an ER diagram for that schema.
Specify key attributes of each entity type and structural constraints on each relationship type.
Note any unspecified requirements, and make appropriate assumptions to make the
specification complete.
For each journal, an issue with a given number is published in a single year.
The endpage of an article is never smaller than the startpage.
There is never (part of) more than one article on a single page.
A) Based on the above, indicate for each of the following sets of attributes whether it is a key
for Articles or not.
1. {ID};
2. {ID,TR-ID};
3. {ID,title,TR-ID}
4. {title};
5. {title,year};
6. {startpage,journal,issue}
1. ID → title;
2. startpage→ endpage;
3. journal issue→ year
4. title → ID;
5. ID → startpage endpage journal issue;
6. TR-ID → ID
C) Indicate for each of the following queries, how many tuples would be returned if it was
run on the instance of Articles
Good Luck