Professional Documents
Culture Documents
Learning Outcomes
This activity encompasses activities 3A, 3B, 3C
At the end of this activity session, you should be able to:
1. Identify the basic elements of ERD.
2. Convert a given ERD into relational tables.
Activity 3A
Activity Outcome: Identify the basic elements of ERD and design the ERD based on a
given scenario by using Chen’s Model.
SCENARIO
Infinity Design Solution Sdn. Bhd, is an advertising company recently signed a new strategic
agreement to collaborate with Success Software Co., a software contract and consultancy
firm. For now onwards, both company are sharing the resources and knowledge in various
fields. Recently, Success Software Co wants to upgrade their database with the following
information:
Customer - CustomerID, Name, Email, Telephone
Location – LocationID, Address, Type
Rate – RateID, RateClass, RatePerKWH
After doing their preliminary analysis, the have come up with the following business rules:
Customer can have one or more locations
Each location can have one and only one customer
Each location can have one or more rates
Each rate may be used at many locations, or not used at a location
INSTRUCTION:
Answer the entire questions below.
1. Identify all the basic elements of ERD that are involved based on the above scenario:
a) Entity and Attribute
Entity Attribute
Page 29 of 61
DFC 2083 DATABASE DESIGN
has
use
c) Identifier keys
2. Draw the E-R Diagram using Chen’s Model based on the Activity3A.
Page 30 of 61
DFC 2083 DATABASE DESIGN
Activity 3B
Activity Outcome: Identify the basic elements of ERD and design the ERD based on a
given scenario by using Crow’s Foot.
SCENARIO
Infinity Design Solution Sdn. Bhd, is an advertising company was dealing with AIA Insurance
to provide insurance coverage for company vehicles.
AIA needs to keep track of information about the vehicles for Infinity Design Solution Sdn Bhd.
They need to store information of customer, car and accident. Customer information including
LicenseNo, Name, and Address. Customer can own one or more cars, where the car
information including PlateNo, Model and Year. A car not involved or involved in many
accidents. If the car is involved in an accident, the information need to be aware is ReportNo,
Location and Date.
INSTRUCTION:
Answer the entire questions below.
1. Identify all the basic elements of ERD that are involved based on the above scenario:
a) Entity and Attribute
Entity Attribute
own
involve
c) Identifier keys
Page 31 of 61
DFC 2083 DATABASE DESIGN
2. Draw the E-R Diagram using Crow’s Foot Model based on the Activity3B
Page 32 of 61
DFC 2083 DATABASE DESIGN
Activity 3C
Activity Outcome: Convert a given ERD into relational tables.
1. Convert the E-R Diagram based on the Activity 3A into the relational tables.
2. Convert the E-R Diagram based on the Activity 3B into the relational tables.
Page 33 of 61
DFC 2083 DATABASE DESIGN
Learning Outcomes
This activity encompasses activities 3D and 3E
Activity 3D
Activity outcome: Using Chen Model Notation, Draw the ERD for the given scenario below.
There are many soccer teams in Liga Super Malaysia ; each team has an ID,name,main stadium,
and which city this team belongs.Each team has many players,and each player belongs to one
team.Each player has a number,name,DOB,start year and shirt number that he uses.Teams play
matches, for each match you need to keep track the date on which the game is played, match ID
and the final result of the match.Each match has exactly three referees.For each referee have an
referee ID,name,DOB and year of experience.
(10 Marks)
Page 34 of 61
DFC 2083 DATABASE DESIGN
Activity 3E
Activity outcome: Using Crow’s Foot Model Notation, Draw the ERD for the given scenario
below.
Seremban Hospital has several wards. This hospital has a few types of ward depends on types
of patients. Patient information will be recorded into file that patient number, patient name,
address, phone number, IC number, patient and group of blood patient. Each patient is treated
by a doctor at one time but one doctor can treats a number of patients. The information of doctors
recorded are: doctor ID, doctor name, address, phone no, IC no and expertise. The nurses will
be assigned to take care of the patients. Nurses in this hospital are graded based on their
experience, qualification and duration of working in the hospital.
(10 Marks)
Page 35 of 61
DFC 2083 DATABASE DESIGN
Learning Outcomes
This activity encompasses activities 3F, 3G, 3H, 3I and 3J.
Activity 3F
Activity Outcome : Understand normalization in database.
Fill in the appropriate terms for normalization in database based on the following statements.
and ______________________________.
Page 36 of 61
DFC 2083 DATABASE DESIGN
Activity 3G
Activity Outcome : Understand functional and transitive dependencies
in database normalization.
PROJECT
ProjectID EmployeeName EmployeeSalary
100A Jamilah 1500
100A Samad 2000
100B Samad 2000
200A Jamilah 1500
200B Jamilah 1500
200C Affendi 2500
200C Samad 2000
200D Affendi 2500
Assuming that all of the functional dependencies and constraints are apparent in this data,
which of the following statements is true?
ProjectID EmployeeName
ProjectID_ EmployeeSalary
(ProjectID, EmployeeName) EmployeeSalary
EmployeeName EmployeeSalary
EmployeeSalary ProjectID
EmployeeSalary (ProjectID, EmployeeName)
Page 37 of 61
DFC 2083 DATABASE DESIGN
Activity 3H
Activity Outcome: Construct normalization process (UNF – 3NF) based on the given
scenario.
SCENARIO
Success Software Co., a software contract and consultancy firm maintains details of all the
various projects in which its employees are currently involved. These details comprise:
Employee Number
Employee Name
Date of Birth
Department Code
Department Name
Project Code
Project Description
Project Supervisor
Assume the following:
Each employee number is unique.
Each department has a single department code.
Each project has a single code and supervisor.
Each employee may work on one or more projects.
Employee names need not necessarily be unique.
Project Code, Project Description and Project Supervisor are repeating fields.
Page 38 of 61
DFC 2083 DATABASE DESIGN
Learning Outcomes
This activity encompasses activities 3I and 3J.
Activity 3I
Activity Outcome: Construct normalization process (UNF – 3NF) based on the given
relation.
Staff
Project# ProjectName Staff# Position RateHour TotalWorkHour
Name
PA201 ABC Web 00658 Samat Electrical Eng. RM20 20
Development
00500 Halim Web Developer RM22 18
00444 Azie Web Developer RM22 15
PP421 XYZ System 11254 Kamal System Analyst RM25 30
Development
00925 Hazlim Technician RM16 56
PM715 PQR Mobile 00658 Samat Electrical Eng. RM20 40
Development
00500 Anaz Programmer RM18 35
11254 Kamal System Analyst RM25 27
Page 39 of 61
DFC 2083 DATABASE DESIGN
Activity 3J
Activity Outcome: Construct normalization process (UNF – 3NF) based on the given
form.
Page 40 of 61
DFC 2083 DATABASE DESIGN
Learning Outcomes
This activity encompasses activities 4A, 4B
SCENARIO
Miss Suria has been given the task of developing a database for a system of salary for the
company Millennium Cyber Sdn. Bhd. Miss Suria only has been given a month to complete
the task. Based on IT Manager of Infinity Design Solution Sdn Bhd, Miss Suria will be helped by
a practical student. Unfortunately, the student is not familiar with the concept of develop
database by using MySQL. Hence, Miss Suria need to implement workshop for students related
to the concept of SQL. These are some exercises the student will do to improve her skills in
SQL.
INSTRUCTION:
Answer the entire questions below.
Activity 4A
Activity Outcome: Able to create Database, tables and manipulates tables using DDL
statements
Procedures:
Page 41 of 61
DFC 2083 DATABASE DESIGN
Step 3 : Click on SQL tab and type the SQL command(VENDOR table) as shown below.
Step 7 : Type SQL command to change the P_ITEM character length from 35 to 40.
Step 8 : Type SQL command to Add attribute V_AGE into table VENDOR.
Step 9 : Type SQL command to change the data type attribute V_AGE from INT to CHAR.
ALTER TABLE VENDOR
MODIFY V_AGE CHAR;
Step 10 : Type SQL command to Delete attribute V_AGE from table VENDOR.
Page 42 of 61
DFC 2083 DATABASE DESIGN
SET FOREIGN_KEY_CHECKS = 0
DROP TABLE VENDOR;
Activity 4B
Activity Outcome: Able to manipulates tables using DDL statements
(Refer Activity 4A)
Procedures:
Step 1 : Click on SQL tab and type SQL command that insert new data into PRODUCT table .
INSERT INTO
PRODUCT(P_KOD,P_ITEM,P_HANTAR,P_HARGA,V_KOD) VALUES
('JT00833', 'Joystick', 6, 30.99, 25595);
Step 2 : Type the following SQL command to insert another data into PRODUCT table.
INSERT INTO PRODUCT
(P_KOD,P_ITEM,P_HANTAR,P_HARGA,V_KOD)
VALUES (‘KK0011’, ‘Scanner’, 12, 300.99, 21344);
Step 5 : Click on SQL tab and type SQL command to delete a data in the PRODUCT table
using the following command.
Step 6 : Click on SQL tab and type SQL command to delete a data in the PRODUCT table
using the following command.
Page 43 of 61