WORKBOOK ACTIVITY

DFC 2033 DATABASE SYSTEM Table of Contents TOPICS PAGES LAB ACTIVITY 1: Fundamentals of Database Management System LAB ACTIVITY 2: Relational Databases 3 11 LAB ACTIVITY 3: Relational Algebra 18 LAB ACTIVITY 4: Entity Relationship Model 25 LAB ACTIVITY 5: Structured Query Language (SQL) 32 LAB ACTIVITY 6: Database Transaction Management 54 Page 2 of 9 .

Email. RateID. Identify the basic elements of ERD. Nena Electrical Co. Name. Address. or not used at a location 1. RateClass. Type c. Type RateID. Activity 4A Activity Outcome: Identify the basic elements of ERD and design the ERD based on a given scenario by using Chen’s Model. Rate. Name.DFC 2033 DATABASE SYSTEM Lab Activity 4: Entity Relationship Diagram Duration: 4 Hours Learning Outcomes This activity encompasses activities 4A. Address. RateClass. Connectivity and Cardinality Customer has Location Page 3 of 9 . Identify all the basic elements of ERD that are involved based on the above scenario: a) Entity and Attribute Entity Customer Location Rate Attribute CustomerID. 4B and 4C At the end of this activity session. with attributes: CustomerID. Convert a given ERD into relational tables. Design E-R Diagram based on a given scenario by using Chen’s Model and Crow’Foot 3. with attributes: LocationID. Telephone b. you should be able to: 1. Telephone LocationID. 2. Location. with attributes: . Email. Rateperkwh b) Relationship. Customer. Wishes to create a database with the following entities and attributes: a. Rateperkwh After the interviews with the owner you 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.

DFC 2033 DATABASE SYSTEM c) Identifier keys Entity Primary Key 2. Draw the E-R Diagram using Chen’s Model based on the Activity4A(1) that you have identified. Page 4 of 9 .

Model. 1. location and date. where the car information is PlateNo. Customers can own one or more cars. A car not involved or involved in many accidents.DFC 2033 DATABASE SYSTEM Activity 4B Activity Outcome: Identify the basic elements of ERD and design the ERD based on a given scenario by using Crow’s Foot. Year ReportNumber. Identify all the basic elements of ERD that are involved based on the above scenario: a) Entity and Attribute Entity Customer Car Accident Attribute LicenseNo. Customer information is LicenseNo. Location. Connectivity and Cardinality Customer Car own Car involve Accident c) Identifier keys Entity Customer Car Accident Primary Key LicenseNo PlateNo ReportNumber Page 5 of 9 . The company has to store information of customer. If the car is involved in an accident. An automobile insurance company needs to keep track of information about vehicle. car and accident. Date b) Relationship. Name. the information that will be stored is Report_number. model and year. Address PlateNo. name and address.

Draw the E-R Diagram using Chen’s Model based on the Activity4B(1) that you have identified. Page 6 of 9 .DFC 2033 DATABASE SYSTEM 2.

LicenseNo PlateNo Model Customer Name Address Car Year LicenseNo ______ __ Car_Accident PlateNo ReportNumber Accident ReportNumber Location Date Page 7 of 9 . CustomerID Customer Telephone Name Email LocationID Location Address Type CustomerID Rate RateClass RateID RateID Rateperkwh Use LocationID 2.DFC 2033 DATABASE SYSTEM Activity 4C Activity Outcome: Convert a given ERD into relational tables. 1. Convert the E-R Diagram based on the Activity 4A(2) into the relational tables. Convert the E-R Diagram based on the Activity 4B(2) into the relational tables.

Draw the ERD for the given scenario below.DOB.For each referee have an referee ID.Teams play matches.Each team has many players. There are many soccer teams in Liga Super Malaysia . and which city this team belongs.main stadium.name.name.name. each team has an ID. (10 Marks) Page 8 of 9 .and each player belongs to one team. 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.DOB and year of experience.start year and shirt number that he uses.Each match has exactly three referees.DFC 2033 DATABASE SYSTEM Activity 4D Activity outcome : Using Chen Model Notation.Each player has a number.

The information of doctors recorded are : doctor ID. Nurses in this hospital are graded based on their experience. patient and group of blood patient. phone no. Patient information will be recorded into file that patient number. IC number. phone number. qualification and duration of working in the hospital. Seremban Hospital has several wards. Draw the ERD for the given scenario below. patient name. (10 Marks) Page 9 of 9 . IC no and expertise. This hospital has a few types of ward depends on types of patients. address.DFC 2033 DATABASE SYSTEM Activity 4E Activity outcome : Using Crow’s Foot Model Notation. The nurses will be assigned to take care of the patients. Each patient is treated by a doctor at one time but one doctor can treats a number of patients. address. doctor name.