COLLEGE OF COMPUTER STUDIES AND MULTIMEDIA ARTS CCS0021L (INFORMATION MANAGEMENT) [F1-FORMATIVE] Formative Assessment 1 EXERCISE 1 EXPLORING THE ORACLE ENVIRONMENT AND DATA MODELING USING E-R MODEL Student Name / Group Name: Name Role Members (if Group): Section: Professor: I. PROGRAM OUTCOME/S (PO) ADDRESSED BY THE LABORATORY EXERCISE a. Identify, Apply knowledge of computing appropriate to the discipline. [PO: A] b. Understand best practices and standards and their applications. [PO: M II. COURSE LEARNING OUTCOME/S (CLO) ADDRESSED BY THE LABORATORY EXERCISE CCS0021L-Information Management Page 2 of 16 Understand the fundamental concepts and principles of database management and database administration. [CLO: 1] Analyze business rules and translate them into user requirements. [CLO: 2] III. INTENDED LEARNING OUTCOME/S (ILO) OF THE LABORATORY EXERCISE At the end of this exercise, students must be able to: Explore the environment of Oracle DB application. Apply the different database approach. Use Oracle Data Modeler to do data modeling tasks. Convert Rules of organization using Data Modeler IV. BACKGROUND INFORMATION 1 . 2 . 3 . 4 . CCS0021L-Information Management Page 3 of 16 1. Menu Bar – Consists of the File, Edit, View, Team, Tools and Help. 2. Browser Toolbar – It consists the overview of the Logical Model (3) and Relational Model (4) of the ERD. 3. Logical Model This part consists of the Entities, Relations, Inheritances, Views, Subviews, and Display which will be used during the ER modeling These will all appear if your click on the + sign of the Logical model 4. Relational Models This part consists the Tables, Views, Foreign keys, Schemas, Subviews, Physical Models and Displays of the Logical Model when converted to its relational model equivalent. These will appear when the + button is clicked beside the Relational Models By default, the relational model will be labeled Relational_1. BACKGROUND INFORMATION Logical Data Model The goal of a logical data model is to develop an entity relationship diagram that represents the information requirements of the business. Logical data modeling is independent of the hardware or software to be used for the implementation. CCS0021L-Information Management Page 4 of 16 Entity-Relationship Diagram (ERD) is a detailed, logical and graphical representation of the entities, associations and data elements for an organization or business area. Table 2.1 Components of an ERD Component Entity Purpose An object or concept about which you want to store information. Relationship A natural association that exists between two or more entities. Attributes Description of entities and specific pieces of information that must be known. Example - DEPARTMENT - EMPLOYEE - JOB - DEPARTMENT may contain one or many EMPLOYEEs. - An EMPLOYEE must be assigned to one and only one DEPARTMENT. EMPLOYEE - First name - Last name - Email Associative entity is an entity type that associates the instances of one or more entity types and contains attributes that are peculiar to the relationship between those entity instances. It is a relationship that can be modeled as an entity type. Relationship Types One-to-One (1:1) One-to-Many (1:M) or Many-to-One (M:1) Many-to-Many (M:M) Cardinality is the minimum and maximum number of values in the relationship. Minimum values can be either optional (zero) or mandatory (at least one). Maximum values can be either one or many. Figure 2.1 Cardinalities Step-by-Step Construction of ERD 1. Identify entities 2. Find relationships 3. Draw rough ERD 4. Fill in cardinality 5. Define primary keys 6. Draw key-based ERD CCS0021L-Information Management Page 5 of 16 7. 8. 9. 10. Identify attributes Map attributes Draw fully attributed ERD Check results CCS0021L-Information Management Page 6 of 16 V. GRADING SYSTEM / RUBRIC (please see separate sheet) VI. LABORATORY ACTIVITY 1 Instructions: I. Starting a Logical Model Right click on the Logical tab inside the Browser toolbar and click Show Then you will see in the center the Logical (Untitled 1) as your work area CCS0021L-Information Management Page 7 of 16 And you will see these Logical model tools above when your Logical Model work area is opened Your work area : If the Logical Model tool is not found, just right click on the blue area near the Menu bar and click Logical Model on the options found CCS0021L-Information Management Page 8 of 16 N o t e Let’s go over the common buttons used in Logical Model tools The select button selects the entities available. The new entity button creates a new entity. The new M:N relation button creates a many to many relationship between entities. The new 1:N relation button creates a one to many relationship between entities. The new 1:1 relation button creates a one to one relationship between entities. The delete button deletes the object on the Logical model work area. The Engineer to Relational Model button converts the Logical model to a relational model. The Zoom in button zooms in the object or the area The Zoom out button zooms out the object or the area The Fit screen button fits the object on the size of the screen The Default size button makes the area in default screen size. II. Now let us create a sample entity relationship model using the example below. Create an entity relationship diagram of the following: CCS0021L-Information Management Page 9 of 16 In this ERD, the business rule indicates that each department can have one or more employees or many employees work in only one department. Step 1: On the logical model work area, add a new entity by clicking on the “new entity” button. Then click the + cursor on the work area, you will have something like this Step 2: On the general tab, on the name text box, write the name Department. Do not close the window yet. Click on the Attributes tab. You will have something like this: CCS0021L-Information Management Page 10 of 16 Step 3: On the attributes, click the + sign to add an attribute. On the attributes properties type in the following: Name: DeptId Datatype: Logical Type: Numeric Precision: 11 Scale: 0 Tick the “Primary UID” because this attribute is the primary key, and then click Apply. Add another attribute by clicking the green + sign, then on the attribute properties type in the following: Name: DeptName Datatype: Logical Type: varchar Size: 100 Click “Mandatory” because a department name should not be blank Then click ok. CCS0021L-Information Management Page 11 of 16 Step 4: Create another entity using steps 1-3 but for the Employee entity. Add the following attributes to the Employee entity Attribute 1: Name: EmployeeId Datatype: Logical Type: Numeric Precision: 11 Scale: 0 Tick the “Primary UID” because this attribute is the primary key, and then click Apply. Attribute 2: Name: EmployeeName Datatype: Logical Type: varchar Size: 100 Click “Mandatory” because a name of the employee should not be blank Then click ok. You should be having something like this: Step 5: Let us add a relationship between entities. Since the relationship is one to many, click the button “1:M relation” button. Then click on the entity Department entity and click on the employee entity to get a new dialog box like this: CCS0021L-Information Management Page 12 of 16 Then type the details and options found on the picture above. Then click ok and you will have something like this: Step 6: The current logical diagram notation above is Barker notation. Let us change it to Information Engineering notation by clicking on the View tab of the Menu bar, then click on Logical Diagram notation, and click Information Engineering notation. Your diagram will look like this: CCS0021L-Information Management Page 13 of 16 VII. LABORATORY ACTIVITY 2 Prepare an E-R diagram for an online shop. The following describes this organization: Business Rules: The shop has customers. Attributes of customers are customer_id(identifier), Firstname, Lastname, Address, city, province, zip code. A customer can have many orders or none at all. Many orders or none can be placed by one customer. Attributes for orders are order_id (identifier), order_date. One or many orders placed must have at least one product or more. Many products can be placed in the orders. An attribute of the association between products and orders is Quantity. The attributes of products are product_id (identifier), product_name, description and price. Many products are supplied by many suppliers, and many suppliers supplies many products. Attributes of suppliers are supplier_id (identifier), supplier_name, contact_no. An attribute of the association between supplier and products is traceNo. Task 1 Analyze the business rule and fill-in the relationship matrix in Table 2.2 to track the existence of relationships between entities. Table 2.2 Relationship Matrix CCS0021L-Information Management Page 14 of 16 Task 2 Draw a fully attributed ERD with keys based from the relationship matrix you have created in Task 1. Draw it in Oracle SQL Developer Data Modeler. Once the model is done, take a screenshot of your work and paste it here. CCS0021L-Information Management Page 15 of 16 VIII. QUESTION AND ANSWER 1. What are other versions of Oracle database? 2. What is an associative entity? Explain how it was created? IX. REFERENCES Hoffer, Jeff (2016). Modern Database Management 12th edition. Pearson Education Limited Young, M. (2010). Oracle Data Modeling and Relational Database Design, Vol. 1 Student Guide, Oracle. CCS0021L-Information Management Page 16 of 16