0% found this document useful (0 votes)
168 views

Final DB Systems Exam June 2020

The document is an examination paper for a Database Systems course taken on June 20, 2020. It includes the course details, student information, and 5 multiple choice and essay questions worth a total of 40 marks. The questions cover topics such as data normalization, SQL queries, and conceptual database design.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
168 views

Final DB Systems Exam June 2020

The document is an examination paper for a Database Systems course taken on June 20, 2020. It includes the course details, student information, and 5 multiple choice and essay questions worth a total of 40 marks. The questions cover topics such as data normalization, SQL queries, and conceptual database design.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Arab Academy for Science, Technology & Maritime Transport

College of Computing and Information Technology

EXAMINATION PAPER

Course Title: Database System Start Time: 9:00 AM

Course Code: IS273 Exam Time: 2 Hours

Lecturer name: Dr. Sherif Tawfik, Dr. Asser Hassan Exam Date: 20-6-2020

Student Name: -----------------------------------

Registration #: ------------------------------------

Department: --------------------------------------

Data for lecturer only


Marks
Question
Actual Available
1 10
2 4
3 6
4 10
5 10
Total 40
Lecturer Name: Dr. Sherif Tawfik Dr. Asser Hassan,
Date: 20-6-2020 Sign:

EDQMS 2/3 Page 1 of 8


Answer the following questions. Show your work so that partial credits may
be assigned

Question 1: True/False (10 marks)


1- One problem with storing duplicated data is the potential for inconsistent values.

2- A database is a set of one or more computer programs that serves as an intermediary


between the users and the database management system (DBMS).

3- Application programs are responsible for creating, maintaining, and supporting database
backup and recovery systems.

4- Metadata is the user data stored in the database.

5- Candidate keys may or may not be unique.

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.

7- Normalization is the process of removing all functional dependencies from a relation.

8- SQL is a data sublanguage, not a complete programming language.

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.

EDQMS 2/3 Page 2 of 8


Question 2: (4 marks)

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.

EDQMS 2/3 Page 3 of 8


Question 3: (6 marks)
We have 3 tables, Student, Subject and Score.
Student Table

student_id name reg_no branch address

10 Akon 07-WY CSE Kerala

11 Akon 08-WY IT Gujarat

12 Bkon 09-WY IT Rajasthan

Subject Table

subject_id subject_name teacher

1 Java Java Teacher

2 C++ C++Teacher

3 Php Php Teacher

Score Table

score_id student_id subject_id marks

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.

score_id student_id subject_id marks Exam_name total_marks

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?

EDQMS 2/3 Page 4 of 8


Question 4: (10 marks)
Assume you have the database shown below; write the SQL commands to perform the
following questions. In questions (a) through (e), you MUST use SQL Subqueries.
Salesman Table:
Salesman_id Name City Commission
5001 James Hoog New York 0.15
5002 Nail Knite Paris 0.13
5005 Pit Alex London 0.11
5006 Mc Lyon Paris 0.14
5003 Lauson Hen San Jose 0.12
5007 Paul Adam Rome 0.13
Orders Table:
Ord_no Purch_amt Ord_date Cust_id Salesman_id
70001 150.5 2012-10-05 3005 5002
70009 270.65 2012-09-10 3001 5005
70002 65.26 2012-10-05 3002 5001
70004 110.5 2012-08-17 3009 5003
70007 948.5 2012-09-10 3005 5002
70005 2400.6 2012-07-27 3007 5001
70008 5760 2012-09-10 3002 5001
70010 1983.43 2012-10-10 3004 5006
70003 2480.4 2012-10-10 3009 5003
70012 250.45 2012-06-27 3008 5002
70011 75.29 2012-08-17 3003 5007
70013 3045.6 2012-0425 3002 5001
Customer Table:
Cust_id Cust_name City Grade Salesman_id
3002 Nick Rimando New York 100 5001
3005 Graham Zusi California 200 5002
3001 Brad Guzan London 100 5005
3004 Fabian Johns Paris 300 5006
3007 Brad Davis New York 200 5001
3009 Geoff Camero Berlin 100 5003
3008 Julian Green London 300 5002
a) Write a query to display all the orders from the orders table issued by the salesman 'Paul
Adam'. Show the output.
b) Write a query to display all the orders for the salesman who belongs to the city London.
Show the output.
c) Write a query to display the commission of all the salesmen servicing customers in Paris.
Show the output.
d) Write a query to display all the orders which values are greater than the average order value
for 10th October 2012. Show the output.

EDQMS 2/3 Page 5 of 8


Question 5: Answer either question A or B (10 Marks)

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.

EDQMS 2/3 Page 6 of 8


Question B:
Consider the following relation:

Articles(ID, title, journal, issue, year, startpage, endpage, TR-ID)


It contains information on articles published in scientific journals. Each article has a unique ID,
a title, and information on where to find it (name of journal, what issue, and on which pages).
Also, if results of an article previously appeared in a “technical report” (TR), the ID of this
technical report can be specified. We have the following information on the attributes:

 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.

The following is an instance of the relation:

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}

ANSWER IN THE FOLLOWING TABLE


1 2 3 4 5 6
KEY
NOT KEY

EDQMS 2/3 Page 7 of 8


B) Based on the above, indicate for each of the following potential functional dependencies,
whether it is indeed an FD or not.

1. ID → title;
2. startpage→ endpage;
3. journal issue→ year
4. title → ID;
5. ID → startpage endpage journal issue;
6. TR-ID → ID

ANSWER IN THE FOLLOWING TABLE


1 2 3 4 5 6
FD
NOT an FD

C) Indicate for each of the following queries, how many tuples would be returned if it was
run on the instance of Articles

1. SELECT ID FROM Articles WHERE year<2006;


2. SELECT DISTINCT ID FROM Articles WHERE year<2006;
3. SELECT AVG(year) FROM Articles GROUP BY journal;
4. SELECT ID FROM Articles WHERE title LIKE '%d';

ANSWER IN THE FOLLOWING TABLE


1 2 3 4
Number of tuples

Good Luck

Dr. Sherif Tawfik

Dr. Asser Hassan

EDQMS 2/3 Page 8 of 8

You might also like