Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Database Design DBT1111C 5

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

BSc (Hons) Software Engineering,

BSc (Hons) Computer Science with Network


Security
Cohorts: BSE/18A/FT & BCNS/18B/FT

Examinations for 2018 - 2019 / Semester 1 & 2018 /


Semester 2

Resit Examinations for BSE/15A/FT, BSE/17/AFT,


BSE/17B/FT, BCNS/15B/FT & BCNS/18A/FT

MODULE: DATABASE DESIGN

MODULE CODE: DBT1111C

Duration: 2 Hours 30 Minutes

Instructions to Candidates:
1. Attempt ALL questions.
2. Questions may be answered in any order but your answers must
show the question number clearly.
3. Always start a new question on a fresh page.
4. Total marks 100.
5. This question paper contains 4 questions and 7 pages including
this page.

DO NOT TURN PAGE OVER UNTIL INSTRUCTED

Page 1 of 7
DATABASE DESIGN (DBT1111C) SITE/DEC 2018/2019 Sem 1 & 2018/ Sem 2
QUESTION 1 [14 Marks]

(a) What is a database management system?

[2 marks]

(b) Describe briefly the three parts of the Relational Model.

[3 marks]

(c) The term integrity refers to the accuracy or correctness of the data in the database.
Define the following terms:

(i) Domain Integrity

(ii) Entity Integrity

(iii) Referential Integrity

[2 x 3 marks]

(d) Define the following terms:

(i) Tuple

(ii) Degree of a relation

(iii) Cardinality of a relation

[3 x 1 mark]

Page 2 of 7
DATABASE DESIGN (DBT1111C) SITE/DEC 2018/2019 Sem 1 & 2018/ Sem 2
QUESTION 2 [32 Marks]
AYURVEDIC HEALTH AND MASSAGE CENTER

The case study given below is about the AYURVEDIC HEALTH and MASSAGE CENTER
(AHMC).

The AHMC is managed by the Human Service Trust of Mauritius and provides a number
of health Services to its patients for examples: Sauna Bath, Body Massage, Acupuncture
and Acupressure among others. When a Patient comes at the center, he/she has to
register by providing his Last Name, First Name, Gender, Date of Birth, NIC, Address and
Mobile Number. Upon registration he is given a unique Patient_ID.

Once the Patient is registered in the system, an Appointment is created with a Physician.
The identifier for the Appointment is Appointment_ID and other attributes include
Appointment Date, Appointment Time and Appointment Status. A Patient can have many
Appointments but an Appointment is created for one Patient only. The identifier for a
Physician is Physician_ID and other attributes include: Last Name, First Name, Date of
Birth, NIC, Date Hired and Mobile Number. A Physician can attend many Appointments
but an Appointment is attended by one and only one Physician.

An appointment may generate a Prescription or may not generate any, but a Prescription
must be generated by one Appointment only. The identifier for Prescription is Prescription
ID and other attributes include is Prescription Date.

A Prescription must include one or many Medicines and a Medicine may be included in
many Prescription. Two attributes which are associated with the relationship is
Doze_Per_Day (how many to take per day) and Before_After_Meal (When to take the
medicine). The identifier for medicine is Medecine_ID and other attributes are
Medecine_Scientific_name and Medecine_Common_Name.

An Appointment may require many Sessions for a Service, but a Session is associated
with one and only one Appointment. The identifier for Session is Session_ID and other
attributes include: Session_Date and Session_TimeFrom.

A Service may be found in many Sessions, but a Session must be related to one Service
only. The identifier for Service is Service_ID and other attributes include: Service_Name,
Service_Price and Duration.

A Session for a Service is done by a Physiotherapist, but a Physiotherapist does many


Session on a daily basis. The identifier for a Physiotherapist is Physio_ID and other
attributes include: Last Name, First Name, Date of Birth, NIC, Mobile and address.

(a) Produce an Entity Relationship Diagram (Logical Data Structure) for the above
scenario. For each entity, identify the primary key attribute and label each relationship
with the appropriate role and cardinality.

[15 marks]
(b) Translate your ERD into a relational database schema.

[17 marks]

Page 3 of 7
DATABASE DESIGN (DBT1111C) SITE/DEC 2018/2019 Sem 1 & 2018/ Sem 2
QUESTION 3 [19 Marks]
(a) What is normalization?
[2 marks]
(b) Using the INVOICE Table structure given below, give an example of a
DELETION anomaly.
[2 marks]
(c) Using the INVOICE table structure shown below, write the relational schema,
draw its dependency diagram and identify all dependencies (including all partial,
transitive and fully functional dependencies).
[7 marks]
INVOICE TABLE
INV_NUM PROD_NUM SALE_DATE PROD_DESCRIPTION VEND_CODE VEND_NAME NUM_SOLD PROD_PRICE

10002 AA-3WD 12-JAN-06 Rotary Sander 200 Nice agency 2 $49.90

10002 BB-ERD 12-JAN-06 Power Drill 200 Nice agency 1 $280.99

10002 BD-CDT 12-JAN-06 Band Saw 201 Good Inc. 4 $28.90

10003 AA-3WD 13-JAN-06 Rotary Sander 200 Nice agency 5 $49.90

10004 BD-CDT 13-JAN-06 Band Saw 201 Good Inc. 2 $28.90

Where INV_NUM means Invoice Number, PROD_NUM means Product Number,


VEND_CODE means Vendor Code, VEND_NAME means Vendor Name, NUM_SOLD
means number of product sold.

(d) Using the answer from part (c) above, remove all partial dependencies, write the
relational schema, and draw the new dependency diagrams. Identify the normal forms
for each table structure you created.
[4 marks]
(e) Using the answer from part (d) above, remove all transitive dependencies, write
the relational schema and draw the new dependency diagrams. Also identify the
normal forms for each table structure you created.
[4 marks]

Page 4 of 7
DATABASE DESIGN (DBT1111C) SITE/DEC 2018/2019 Sem 1 & 2018/ Sem 2
QUESTION 4 [35 Marks]
This question refers to the database Schema given in Appendix.

(a) Draw an ERD for the Relational Schema given in the Appendix.
[3 marks]
(b) Write the SQL code that will create the Author table given in the appendix. Make
the Au_ID the primary key of the table.
[3 marks]

(c) Assuming that the Publisher table and the Book table has been created
successfully in the user schema, write SQL code to create the Book_Author
table and make the ISBN and AU_ID as the Foreign key constraint and also
make both the above columns to be a composite Primary key of the table.
[4 marks]
(d) Write SQL code to add a column called EMAIL in the Publisher table to store the
email address of the publisher.
[2 marks]

(e) Write SQL code to add a constraint on the email column so that no two publisher
will have the same email address.
[3 marks]

(f) Write the SQL code to delete the publisher whose name is HIGHTEXT PUBNS.
[2 marks]

(g) Write the SQL code to change the year born value from 1970 to 1971 for the
author whose AU_ID is 1.
[2 marks]
(h) Write SQL code to display the name of publishers who have not provided any
telephone number.
[2 marks]
(i) Write the SQL code required to list all book details whose title’s contains the
word “Information”.
[3 marks]
(j) Write SQL code to display the last name and first name of all authors who were
born in the year 1970.
[2 marks]

(k) Write the SQL code to display the last name and first name of all the authors
who have written the book with title “Structured C for Engineering and
Technology/Book and Diskette”
[5 marks]
(l) Write SQL code to display the ISBN and the title of all the book published by
Prentice Hall in 1988. [4 marks]

Page 5 of 7
DATABASE DESIGN (DBT1111C) SITE/DEC 2018/2019 Sem 1 & 2018/ Sem 2
APPENDIX
Author
Au_ID Au_Lname Au_Fname Year_Born
1 Jacobs Russell 1970
2 Metzger Phillip 1965
3 Boddie John 1964
4 Sydow Dan Parks 1980
6 Lloyd John 1985
8 Thiel James 1990
10 Ingham Kenneth 1970
12 Wellin Paul 1971
13 Kamin Sam 1984

Publisher
PubID Name Company Name Street City State Zip Telephone

1 SAMS SAMS 11711 N. College Ave., Ste 140 Carmel IN 46032

2 PRENTICE HALL PRENTICE HALL 15 Columbus Cir. New York NY 10023 800-922-0579

3 M&T M & T BOOKS


4 MIT MIT PR
5 MACMILLAN COMPUTER MACMILLAN COMPUTER PUB 11 W. 42nd St., 3rd flr. New York NY 10036 212-869-7440

6 HIGHTEXT PUBNS HIGHTEXT PUBNS


7 SPRINGER VERLAG SPRINGER VERLAG
8 O'REILLY & ASSOC O'REILLY & ASSOC 90 Sherman St. Cambridge MA 02140

9 ADDISON-WESLEY ADDISON-WESLEY PUB CO Rte 128 Reading MA 01867 617-944-3700

10 JOHN WILEY & SONS JOHN WILEY & SONS 605 Third Ave New York NY 10158 212-850-6000

Book
Year
ISBN Title PubID
Published
0-0038307-6-4 dBASE III : A Practical Guide 1989 10
0-0038326-7-8 The dBASE Programming Language 1988 2
0-0038337-8-X dBASE III Plus 1995 2
Database Management : Developing Application Systems Using
0-0131985-2-1 1989 1
Oracle
0-0133656-1-4 Wordstar 4.0-6.0 Quick Reference Guide 1990 3
0-0134436-3-1 Oracle Triggers and Stored Procedure Programming 1996 4
0-0201145-8-3 Programming in Clipper 1988 4
0-0201406-7-3 Inside MacIntosh 1994 8
0-0207992-0-9 Omni Online Database Directory 1983 9
0-0230081-2-1 Structured C for Engineering and Technology/Book and Diskette 1995 5
An Introduction to Assembly Language Programming for the Intel
0-0230362-0-6 1995 7
8088 Microprocessor
Applied Calculus With Linear Programming : For Business,
0-0230650-8-7 Economics, Life Sciences, and Social Sciences (College 1995 7
Mathematics Series

Page 6 of 7
DATABASE DESIGN (DBT1111C) SITE/DEC 2018/2019 Sem 1 & 2018/ Sem 2
Book_Author

ISBN Au_ID
0-0038307-6-4 1
0-0038326-7-8 1
0-0038337-8-X 3

0-0131985-2-1 12

0-0131985-2-1 10
0-0133656-1-4 2
0-0134436-3-1 10
0-0134436-3-1 12
0-0230081-2-1 12
0-0230081-2-1 1
0-0230081-2-1 10
0-0230362-0-6 2
0-0230362-0-6 3
0-0230650-8-7 10

***END OF QUESTION PAPER***

Page 7 of 7
DATABASE DESIGN (DBT1111C) SITE/DEC 2018/2019 Sem 1 & 2018/ Sem 2

You might also like