You are on page 1of 5

Ministry of Higher Education Misr Higher Institute for Engineering & Technology

Subject : Databases Design Subject Code: CSE 3523


Department : Computer Engineering Year : Third
Date: Lab Examination- Second Semester – 2019/2020 Time : 30 Minutes
Question Bank Examiner: Assoc. Prof. Sally Elghamrawy
Name: Section:
1. Normalize this table to the 3 NF
Prof_ID Name Dept_No Dept_name Dept-place Courses
1 Ali De. 32 CSE Mansoura Java, Structure, C++
2 Mostafa E 32 CSE Mansoura PLC., Simulation
3 Ahmed N. 21 Communication Cairo Logic, Architecture., Signals.
4 Sally G. 44 Computers MET Programming, Database
Answer:
1. 1NF
Prf_ID Name Dept_No Dept_name Dept-place Courses
1 Ali De. 32 CSE Mansoura Java
1 Ali De. 32 CSE Mansoura Structure
1 Ali De. 32 CSE Mansoura C++
2 Mostafa E 32 CSE Mansoura PLC
2 Mostafa E 32 CSE Mansoura Simulation
3 Ahmed N. 21 Communication Cairo Logic
3 Ahmed N. 21 Communication Cairo Architecture
3 Ahmed N. 21 Communication Cairo Signals
4 Sally G. 44 Computers MET Programming
4 Sally G. 44 Computers MET Database
2NF
Prf_ Name Dept Dept_name Dept-
3NF
ID _No place
1 Ali De. 32 CSE Mansoura Prf_ID Name Dept_
2 Mostafa E 32 CSE Mansoura No

3 Ahmed N. 21 Communication 1 Ali De. 32


Cairo
4 Computers 2 Mostafa E 32
Sally G. 44 MET
3 Ahmed N. 21
Prf_ID Courses
4 Sally G. 44
1 Java
1 Dept_No Dept_name Dept-place
Structure
1 C++ 32 CSE Mansoura

2 PLC 21 Communication Cairo

2 Simulation 44 Computers MET


3 Logic
3 Architecture
3 Signals
4 Programming
4 Database
2. “CIB bank needs to create a database to store information of their customers”. First step, each customer’s personal
details (name, address, job, and account number) are recorded in the database, then they are given an entry number.
Each customer will be assigned to a specific department (Certificates, Current Accounts, Insurance, and Loans). In each
department, there are a number of Managers and accountants. A customer will be treated by one Manager and several
accountants over the time of their stay, and each Manager and accountant may be involved with several Customers at
any given time.”

a. Draw an entity-relationship diagram showing the items you identified.


The Entities are Attributes Cardinality ratios:
customer, Department, Manager, Customer has: Name, Address, job, Department and Customer: 1:M
Accountants account number, entry number. Department and Accountant: 1:M
Department has: a Name (which can Department and Manager: 1:M
be Certificates, Current Manager and Customer: 1:M
Accountant and Customer: M:M
Accounts, Insurance, and
Loans.).

Customer

Manager Accountant

Department

3. Identify the entities, attributes, relationships, and cardinality ratios in the following E/R
Diagram.
The Entities are Attributes Cardinality ratios:

Worker, Department,  worker has: Name, workerID and Address. Worker and Department: M : 1
Project, Order Supplier  Project has: Name and ProjectID Worker and Project: M:M
 Order has: OrderID, orderdate delivery date Worker and Order: M:M
 Supplier has: Name and SupplierID Order and Supplier: M:M
 Department has: Name, Department ID and
Address.

4. Normalize this table to the 3 NF


Child_ID Name School_No School_name School Location Courses
1 Yassin E. 12 DMLS Mansoura Draw, P.E, Math
2 Ahmed M. 12 DMLS Mansoura Eng., Art
3 Menna T. 19 WIS Alexandria Rel., Hist., Arab.
4 Perla E. 14 Glory Cairo Social, Science

1NF
Child_ID Name Nursery_No Nursery_name Nursery Location Courses
1 Yassin E. 12 DMLS Mansoura Draw
1 Yassin E. 12 DMLS Mansoura P.E
1 Yassin E. 12 DMLS Mansoura Math
2 Ahmed M. 12 DMLS Mansoura Eng.
2 Ahmed M. 12 DMLS Mansoura Art
3 Menna T. 19 WIS Alexandria Rel.
3 Menna T. 19 WIS Alexandria Hist
3 Menna T. 19 WIS Alexandria Arab.
4 Perla E. 14 Glory Cairo Social
4 Perla E. 14 Glory Cairo Science

2NF 3NF
Child Name Nurse Nursery_name Nursery
_ID ry_No Location
Child Name Nurse
1 Yassin 12 DMLS Mansoura _ID ry_No

2 Ahmed M. 12 DMLS Mansoura 1 Yassin 12

3 Menna T . 19 WIS Alexandria 2 Ahmed M. 12

4 Perla E. 14 Glory Cairo 3 Menna T . 19

4 Perla E. 14
Child_ID Courses
1 Draw Nursery_ Nursery_name Nursery
No Location
1 P.E
12 DMLS Mansoura
1 Math
2 Eng. 19 WIS Alexandria

2 Art 14 Glory Cairo


3 Rel.
3 Hist
3 Arab.
4 Social
4 Science

5. ““Marassi Hotel needs to create a database to store information about their Guests”. First step, each Guest’s
personal details (name, Credit card, City, and ID) are recorded in the database, then they are given a Guest

number. Each Guest will register in a specific activity (Jet Ski, Gym, Pool, and Spa). In each activity, there are
a number of Managers and Assistants. A guest will be treated by one Manager and several Assistants over the
time of their stay, and each Manager and Assistant may be involved with several Guests at any given time.”

1. Identify the entities, attributes, relationships, and cardinality ratios from the description.
The Entities are Attributes Cardinality ratios:
Guests, Activity, Manager, Assistants Guest has: Name, credit, city, ID. Activity and Guest: 1:M
activity has a Name (which can be Jet Activity and instructor: 1:M
Ski, Gym, Pool, and Spa). Activity and professor: 1:M
Managers and Guest: 1:M
Assistant and Guests: M:M
2. Draw an entity-relationship diagram showing the items you identified.

Name Credit City ID

Guest

Managers Register Assistants

Activity
6. Normalize this table to the 3 NF
Company_ID Name Account_No Account_Type Location Products
1 Samsung 52002 Permanent Korea Mobiles, T.V, Tabs
2 Sony 52002 Permanent Japan Laptops, Smart phones
3 LG 93201 Temporary Korea Notebooks, DVD, Dish washers.

1NF
Company_ID Name Account_No Account_Type Location Products
1 Samsung 52002 Permanent Korea Mobiles
1 Samsung 52002 Permanent Korea T.V
1 Samsung 52002 Permanent Korea Tabs
2 Sony 52002 Permanent Japan Laptops
2 Sony 52002 Permanent Japan Smart phones
3 LG 93201 Temporary Korea Notebooks
3 LG 93201 Temporary Korea DVD
3 LG 93201 Temporary Korea Dish washers

2NF
ID Name No Type Location
3NF
1 Samsung 52002 Permanent Korea
ID Name No. Location

2 Sony 52002 Permanent Japan 1 Samsung 52002 Korea

3 LG 93201 Temporary Korea 2 Sony 52002 Japan


3 LG 93201 Korea
ID Products
1 Mobiles No Type
1 T.V
52002 Permanent
1 Tabs
93201 Temporary
2 Laptops
2 Smart phones
3 Notebooks
3 DVD
3 Dish washers

With My Best Wishes . . . .

Dr. Eng. Sally El-Ghamrawy

You might also like