Data Modeling ISYS 464. Install Oracle 10g Express Website to download: –http://www.oracle.com/technology/products/database/xe/index.html –Choose Linux.

Slides:



Advertisements
Similar presentations
Entity Relationship Diagrams
Advertisements

Database Design The process of finding user requirement
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Systems Development Life Cycle
Data Modeling and Relational Database Design ISYS 650.
Database Design & Mapping
System Analysis - Data Modeling
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Lecture Eleven Entity-Relationship Modelling
Data Modeling with ERD ISYS 363. Entity-Relationship Diagram An entity is a “thing” in the real world, such as a person, place, event for which we intend.
Modeling Data The Entity Relationship Model (ER) For Database Design.
Data Modeling ISYS 464. Database Design Process Conceptual database design: –The process of creating a data model independent of implementation details.
Data Modeling ISYS 464. Database Design Process Conceptual database design: –The process of creating a data model independent of implementation details.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Information Resources Management January 30, 2001.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
Entity-Relationship (E-R) Model
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Chapter 3)
Modern Systems Analysis and Design Third Edition
APPENDIX C DESIGNING DATABASES
Data Modeling 1 Yong Choi School of Business CSUB.
Entity-Relationship modeling Transparencies
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Data Modeling Using the Entity-Relationship Model
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
1. 2 Data Modeling 3 Process of creating a logical representation of the structure of the database The most important task in database development E-R.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Chapter 5 Entity–Relationship Modeling
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter 6 Structuring.
CSCI 3140 Module 2 – Conceptual Database Design Theodore Chiasson Dalhousie University.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
9/10/2012ISC 329 Isabelle Bichindaritz1 Entity Relationship (E-R) Modeling.
Conceptual Data Modeling. What Is a Conceptual Data Model? A detailed model that shows the overall structure of organizational data A detailed model.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
Data Modeling ISYS 464.
Entity-Relationship Modeling Based on Chapter 12.
Chapter 8 Methodology - Conceptual Database Design Chapter 15 in Textbook.
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
1 Entity-Relationship Model © Pearson Education Limited 1995, 2005.
Data Modeling with ERD BUS 782. Entities An entity is a person, place, object, event, or concept in the user environment about which the organization.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
1 Database Systems Entity Relationship (E-R) Modeling.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
DBMS ER model-2 Week 6-7.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Data Modeling with ERD ISYS 363.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
Data Modeling ISYS 464.
Entity-Relationship Modeling
بسم الله الرحمن الرحيم.
Overview of Entity‐Relationship Model
Entity Relationship Diagrams
Conceptual Database Design
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Presentation transcript:

Data Modeling ISYS 464

Install Oracle 10g Express Website to download: – –Choose Linux or Windows version –Choose: Oracle Database 10g Express Edition (Western European) Installation guide: – oc.htm Getting started guide: – oc.htm Two types of accounts: –System administrator: Remember the name and password used to install the Oracle. This account lets you to create/delete user account. –User Sample database: HR (Human Resource Database) –This database initially is “locked”. You need to login as an Administrator to unlock the HR database. –User name: HR, Password: HR

Start and Login to Oracle 10g Exp To start:From Oracle PopUp menu, choose –Start database: wait for the services to complete: The OracleXETNSListener service was started successfully. The OracleServiceXE service is starting The OracleServiceXE service was started successfully. –Then choose: Go to database home page Login Accounts –System administrator –User Logout –Stop database

Start and End MySQL MySQL is installed as a service. To start MySQL: –Control Panel/Administrative Tools/Services/MySQL/ start MySQL Administrator MySQL Query Browser MySQL Command Line Client To stop MySQL: –Control Panel/Administrative Tools/Services/MySQL/ Stop

Database Design Process Conceptual database design: –The process of creating a data model independent of implementation details such as the target database model and physical considerations. Logical database design: –The process of designing database logical structure based on a specific database model (such as relational model), but independent of a particular DBMS and physical considerations. Physical database design: –The process of implementing the database on a secondary storage.

Requirements Collection and Analysis The process of collecting and analyzing information about the organization that is to be supported by the database system, and use this information to identify the requirements for the new system.

NBC Olympic Website

Making Airlines Reservations US Airways -- Select your seats Web check-In

Supermarket Advertisement LuckyMarket presents another great way to save with your LuckyMarket Rewards Card! You can get up to 4 FREE movie tickets! From Feb. 01 through June 9, 200X, use your LuckyMarket Rewards Card every time you shop at LuckyMarket. When you accumulate between $250 - $ in groceries during the qualifying period, you get 2 FREE movie tickets! And if you purchase $400 or more during the same period you get 4 FREE movie tickets!

Fact-Finding Techniques Examining documentation –Defining problem and need for database: Internal memos, minutes of meetings, documents that describe the problem, organizational chart –Describe the current system: Various types of flowcharts and diagrams, data dictionary, database system design, program documentation Interviewing Observing the enterprise in operation Questionnaires

User Views A user view defines what is required of a database system in terms of the data to be held and transactions to be performed on the data from the perspective of a particular job role or enterprise application area. Identifying user views helps to ensure that no major users of the database are forgotten when developing the requirements for the new database system. Examples of user views: –Reports, Forms, documents

Conceptual Database Design Methodology Identify entity types. Identity relationship types between the entity types. Identify and associate attributes with entity or relationship types. Determine attribute domains. Determine candidate keys and primary key. Validate conceptual model: –Check for redundancy, support required transactions, review the model with user

Objectives of Database design Be able to link related records in the database. Eliminate data duplication.

Entity-Relationship Diagram ER modeling is a top-down approach to database design that begins by identifying the entities and relationships between entities that must be represented in the model. –Relative ease of use. –Widespread CASE tool support. –The belief that entities and relationships are natural modeling concepts in the real world. –Classifying things according to their various kinds.

ERD Models Entities and Business Rules Example: –A customer may submit any number of orders. However, each order must be submitted by exactly one customer. –A student may register for a section of a course only if he or she has successfully completed the prerequisites for that course.

Entities An entity is a person, place, object, event, or concept in the user environment about which the organization wishes to maintain data. –Person: Employee, Student, patient –Place: Warehouse, Store –Object: Product, Machine. –Event: Registration, Sale, Renewal –Concept: Account, Course Physical existence: Customer, student, product, etc. Conceptual existence: Bank accounts, sale

Entity Type A collection of entities that share common properties or characteristics. An entity type represents a collection of entities. In an ERD, it is given a singular name. Diagrammatic representation: –A rectangle labeled with the name of the entity

Entity Instance An entity instance is a single occurrence of an entity type: –Student entity: SID, Sname, Major –Two instances of Student entity type: S1, Peter, Bus S5, Paul, Sci

Relationship Type Relationship: Interaction between entity types. –It is an association representing an interaction among the instances of one or more entity types that is interest to the organization. It has a verb phrase name: –Faculty teach Course, Faculty advise Student –Customer open Account, Customer purchase Product.

Figure 3-10 Relationship types and instances a) Relationship type b) Relationship instances

Binary Relationship A relationship involves two entity types. Three kinds of Binary Relationship - –1:1 –1:M –M:M Determined by business rules

M:M Relationship Peter Paul John Woody Alan Mary Linda Nancy Mia Pia A boy may date 0, 1, or many girls. A girl may date 0, 1, or many boys. Note: “Many boys date many girls” is not a correct interpretation. Boy Girl

1:1 Relationship Peter Paul John Woody Alan Mary Linda Nancy Mia Pia A man may marry 0 or 1 woman. A woman may marry 0 or 1 man. Man Woman

1:M Relationship Peter Paul John Woody Alan Mary Brian Linda Aron Nancy Ronald Mia Pia A father has 1 or many children. A child has 1 father. Father Child

Cardinality Constraint A cardinality constraint specifies the number of instances of entity type A that can (or must) be associated with each instance of entity type B. Participation constraint –Full participation (Mandatory) –Partial participation (Optional)

Notations

Other Notations UML Notations: –0..1, 1..1 –0..*, 1..* –3..5 Traditional: Student Account Has 11 Student Account Has 1..1

1:1 Relationship Examples: –Husband, Wife –State, State Governor –Order, Invoice

1:M Relationship Examples: –Father, Child –Department, Employee –Customer, Order

M:M Relationship Examples: –Boy friend, Girl friend –Bank customer, Bank account –Student, Student organization

Traditional ERD Notations Student Account Faculty Course Has 11 Enroll MM Advise M 1 Teach M 1

UML ERD Notations Student Account Faculty Course Has 1..1 Teach 1..*1..1 Enroll 0..* Advise 0..* 1..1

Book Notations Student Account Faculty Course Has Teach Enroll 0..* Advise

Other Examples A database to record visitors and web pages they view. An online shopping website database to record customers, orders (shopping carts) and products purchased by customers. An auction database to record sellers and the items they sell, buyers and the items they purchase. Supermarket advertisement

Recursive Relationship A relationship type where the same entity type participates more than once in different roles. Examples: –Employee – Supervise -- Employee –Student -- Tutor– Student –Faculty – Evaluate -- Faculty

Employee Supervise Supervisor Supervisee Employee Supervise M 1

Attributes Properties of an entity or a relationship. Simple and composite attributes –Address:Street address, City, State, ZipCode –Street Address: Number, Street, Apt# –Phone#: Area Code, number Single-valued and multi-valued attributes –Student’s Major attribute –Faculty’s DegreeEarned attribute –Vehicle’s Color attribute –Others: PhoneNumber, Address Derived attributes Keys: Key attribute uniquely determines an entity. –Candidate key, primary key, composite key

UML Notations Student SID {PK} Sname Fname Lname Address Street City State Zip Phone[1..3] Sex DateOfBirth /Age

SID {PK} Sname( Fname, Lname) Address( Street, City, State, Zip) {Phone} Sex DateOfBirth [Age]

Student SID Sname FnameLname Phone DateOfBirth Age

Domains of Attributes The set of allowable values for one or more attributes. Input validation Examples: –Sex: F, M –EmpHourlyWage: Between 6 and 300 –EmpName: 50 characters

Time-Dependent Attributes Auditing Reconstructing the database state at a point in time: –Database snapshot Regulations: –Sarbanes-Oxley Public Company Accounting Reform and Investor Protection Act of 2002 and commonly called SOX or SarbOx; July 30, 2002) Example: ProductPrice: PID, {PriceHistory(Price, TimeStamp)}

Attributes on Relationship Online Shopping Cart Customer ShoppingCart Product Has 1 M M M CID Cname Addr CartIDDate PID Pname Price

Order Form

Online Shopping Cart Customer ShoppingCart Product Has 1 M M M CID Cname Addr CartIDDate Qty PID Pname Price

Attributes on Relationship Examples: –Student/Course: Grade –Order/Product: Quantity

Enroll 0..* Student SID Course CID Grade StudentCourse Enroll M M Grade

Figure 3-11a A binary relationship with an attribute Here, the date completed attribute pertains specifically to the employee’s completion of a course…it is an attribute of the relationship

Figure 3-11b An associative entity (CERTIFICATE) Associative entity is like a relationship with an attribute, but it is also considered to be an entity in its own right. Note that the many-to-many cardinality between entities in Figure 3-11a has been replaced by two one-to-many relationships with the associative entity.

N-ary Relationship Doctor – Patient – Ailment Police – Crimal – Crime AirCraft – Bomb – Target Note: There is no deterministic relationship (1:1 or 1:M) between any two of these entities.

Figure 3-12 Examples of relationships of different degrees (cont.) c) Ternary relationship Note1: a relationship can have attributes of its own. Note2: This ternary relationship exists only if there is no binary relationship between these three entities.

Problems with ER Models Connection Traps Fan traps: Where a model represents a relationship between entity types, but the pathway between certain entity occurrences is ambiguous StaffDivision Branch Has Oversees 1..* * Which branch does Peter work? Division Branch Oversees 1..* 1..1 Staff Has 1..* 1..1

Entity Type not System User or Organizational Unit ReportMe SendTo MyCompanyDepartment Has Note: An entity type represents a collection of entities.

Entities can be related to one another in more than one way Figure 3-21 Examples of multiple relationships a) Employees and departments Example: Auction site: User and Auction Item