INF1343, Winter 2012 Data Modeling and Database Design Yuri Takhteyev Faculty of Information University of Toronto This presentation is licensed under.

Slides:



Advertisements
Similar presentations
More Diagramming & Practice with Relationship Modeling
Advertisements

Information System Analysis Lab 7. ERD entity-relationship diagram is a data modeling technique that creates a graphical representation of the entities,
ENTITY RELATIONSHIP MODELLING
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Concepts of Database Management Seventh Edition Chapter 6 Database Design : ERD Model.
Entity Relationship (ER) Modeling
IT420: Database Management and Organization
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Basic Symbols.
8 June Single table database in normal form Fields and records Normal form 1.Header in the first line 2.Same content for every field 3.Each record.
FIS 431/631 Financial Information Systems: Analysis and Design REA Modeling Joe Callaghan Oakland University Department of Accounting & Finance.
Lecture 3 :Database Analysis and Design (II)
Relational Databases What is a relational database? What would we use one for? What do they look like? How can we describe them? How can you create one?
Data Modeling and Entity- Relationship Model I IST2101.
MIS2502: Data Analytics Relational Data Modeling
MS Access 2007 IT User Services - University of Delaware.
Data Modeling Using the Entity-Relationship Model
Data Modeling and Relational Database Design. Analyze and model the relationships between entities Draw an initial entity relationship diagram Read the.
Data Modeling using Entity Relationship Diagramming (ERD)
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.
2.3 Organising Data for Effective Retrieval
Digital Media Technology Week 11. Stylesheet languages vs. Querying languages.
Practice of ER modeling
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
Entity-Relationship (ER) Modelling ER modelling - Identify entities - Identify relationships - Construct ER diagram - Collect attributes for entities &
Chapter 7 Data Modeling with Entity Relationship Diagrams
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
IMS 4212: Introduction to Data Modeling—Relationships 1 Dr. Lawrence West, Management Dept., University of Central Florida Relationships—Topics.
ERD ( Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes.
MIS2502: Data Analytics Relational Data Modeling
Lecture 91 Introduction to Data Analysis and Logic Specification Objectives l Draw an entity-relationship diagram, and explain the types of entity relationships.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
MIS2502: Data Analytics Relational Data Modeling David Schuff
Lecture 5 Entity Relationship Modeling
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
Data Modeling and Entity-Relationship Model I
CCT395, Week 4 Database Design and ER Modeling This presentation is licensed under Creative Commons Attribution License, v To view a copy of this.
INF1343, Winter 2011 Data Modeling and Database Design Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
INF1343, Week 6 Implementing a Database with SQL This presentation is licensed under Creative Commons Attribution License, v To view a copy of this.
CCT395, Week 11 Review, Permissions Physical Storage and Performance This presentation is licensed under Creative Commons Attribution License, v. 3.0.
CCT395, Week 6 Implementing a Database with SQL and a Case Study Exercise This presentation is licensed under Creative Commons Attribution License, v.
INF1343, Winter 2012 Data Modeling and Database Design Yuri Takhteyev Faculty of Information University of Toronto This presentation is licensed under.
CCT396, Fall 2011 Database Design and Implementation Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
INF1343, Week 4 Database Design and ER Modeling This presentation is licensed under Creative Commons Attribution License, v To view a copy of this.
CCT396, Fall 2011 Database Design and Implementation Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
CCT395, Week 5 Translating ER into Relations; Normalization This presentation is licensed under Creative Commons Attribution License, v To view a.
INF1343, Winter 2011 Data Modeling and Database Design Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
Database Design Chapters 17 and 18.
Data Modeling Using the ERD
Assignements.
Data Modeling Using the Entity- Relationship (ER) Model
Databases Chapter 9 Asfia Rahman.
Translating ER into Relations; Normalization
Special Topics in CCIT: Databases
MIS2502: Data Analytics Relational Data Modeling
Database Design and Implementation
Data Modeling and Database Design INF1343, Winter 2012 Yuri Takhteyev
Database Design and Implementation
Data Modeling and Database Design INF1343, Winter 2012 Yuri Takhteyev
بسم الله الرحمن الرحيم.
Entity-Relationship Modeling "Extended"
MIS2502: Data Analytics Relational Data Modeling
Database Design Chapters 17 and 18.
MIS2502: Data Analytics Relational Data Modeling
MIS2502: Data Analytics Relational Data Modeling 2
Entity-Relationship Modeling "Extended"
Entity-Relationship Modeling "Extended"
Presentation transcript:

INF1343, Winter 2012 Data Modeling and Database Design Yuri Takhteyev Faculty of Information University of Toronto This presentation is licensed under Creative Commons Attribution License, v To view a copy of this license, visit This presentation incorporates images from the Crystal Clear icon collection by Everaldo Coelho, available under LGPL from

Week 3 The ER Model

The Relational Model persona species_type species

1. Serves the purpose. 2. Simplifies updates. 3. Avoids “anomalies”. Good DB Design

Two Approaches 1. Start with whatever, then fix it 2. Start by modeling ER Modeling

The DB Lifecycle requirements analysis implementation deployment design

clientyoudatabaseusers the problem functional specification clarification a design a schema use feedback a new problem

Functional Specifications What is the system going to do? (Not how, but what.)

Course Enrollment What do we want from a course enrollment system?

“Use Cases” A student wants to enroll in a course for the next semester. The student goes to the website for the enrollment system and logs in. The student is presented with a list of courses there he or she is enrolled in. There is a button next to each course to un-enroll from it. There is also a search box that the student can use use to look for courses that they are not enrolled in. The student can find the course by the course code or course title...

ER Model E is for “Entities” R is for “Relationships” (“relationships” != “relations”) (A visual / diagramming language.)

Other Diagrams Flowcharts Sequence diagrams Data flow diagrams All of those are NOT ER diagrams

Flowcharts Not an ERD!

clientyoudatabaseusers the problem functional specification clarification a design a schema use feedback a new problem Not an ERD!

ProfessorStudent database “persistent storage” submits assignment submits grade the grade is stored the grade is retrieved displays grade Not an ERD!

Custome r 2. Accep t Order order informatio n orders 3. Dispatc h Order Warehouse book data 1. Locate Book order informatio n book informatio n quer y book informatio n Not an ERD!

ER Diagrams Not what happens to the data, but the structure of the data itself. Normally does not show actors or repositories, but objects (“entities”) about which we have information. (The relationships between the entities is one kind of information about them.)

Entities The “things” we need to keep track of in our database.

“Use Cases” A student wants to enroll in a course for the next semester. The student goes to the website for the enrollment system and logs in. The student is presented with a list of courses there he or she is enrolled in. There is a button next to each course to un-enroll from it. There is also a search box that the student can use use to look for courses that they are not enrolled in. The student can find the course by the course code or course title...

Entities Entities in a course enrollment system: students courses instructors rooms time slots

student last name first name utorid date of birth attributes programcoursepayment other entities

Entities vs Attributes Attributes usually atomic values, e.g. a number, a string, a date Entities bundles of values (But are dates really atomic?)

One Entity or Two? The book and its author? The book and its title? The film and its director? The film and its title? The city and its population? The city and its mayor? The user and their account?

student last name first name utorid date of birth “Chen’s notation”

student last name first name utorid date of birth “UML notation” (simplified)

Type vs Instance Entity as a type When we say “student” we really mean “students” as a type. Instances of entities Individual students’ records are instances of the “student” entity. (Like rows in a table.)

program course payment student last name first name utorid date of birth

program name code course code title payment amount date session code start date student is in a program student made a payment student is enrolled in a course course is offered in a session student last name first name utorid date of birth course belongs to a program Each relationship is a fact.

ER vs Data Flow Diagrams ER Diagrams The structure of the data itself Data Flow Diagrams The flow of data between the different processing steps.

Compare: John wants to enroll in INF1343. John goes to the website. John clicks on a button. vs “John Doe is enrolled in INF1343.”

Compare: User gets money from an ABM. vs “A cash withdrawal of $200 from account was made at 10:10.”

account type balance ABM id address user amount date this withdrawal was from this account belongs to this user this withdrawal was through this ABM withdrawal amount time

ProfessorStudent database “persistent storage” submits assignment submits grade the grade is stored the grade is retrieved displays grade This is NOT what we are doing represents an actual live student

program name code course code title payment amount date session code start date student is in a program student made a payment student is enrolled in a course course is offered in a session student last name first name utorid date of birth course belongs to a program represents our record of a student

Two Degrees 1.A box in an IR diagram represents a type of record. 2.Records stores information about things in the real world.

A Movie Database What are the entities? Which are related?

Cardinality student last name first name utorid date of birth payment amount date payment amount date payment amount date payment amount date payment amount date one student, many payments “one-to-many” relationship

student last name first name utorid date of birth payment amount date “Crow’s Foot Notation”

not more than 1many “Crow’s Foot Notation”

at least 1 (mandatory) could be 0 (optional) “Crow’s Foot Notation” N

just one zero or many “UML Notation” 1..1 or just “1” 0..N or “0..*” N

More Examples ABMwithdrawal speciespet courseassignment ???

Variations speciespet motherchild ???

Questions on 1:M?

WeWe ❤ 1:M Because they are really easy to represent in a relational database.

Many-to-Many student last name first name utorid date of birth course code title

Examples bookauthor coursesession ???

Movie Database Which relationships are 1:M and which are M:M?

We ! ❤ M:M Because they cannot be represented in a relational database.

Breaking Up M:M student last name first name utorid date of birth course code title

“Associative Entity” student last name first name utorid date of birth course code title enroll ment

Examples book author author ship ??? course session course instan ce

Questions on M:M?

One-to-One ???

One-to-One ???

One-to-One enginecar the engine is installed in the car engines in stock cars shipped

Examples citymayor captainship chef signature dish ???

Recursive Relationships person likes

Recursive Relationships person likes

Examples employee tax return coin image ??? is filed jointly with supervises is the flip side of ???

N-nary Relationships seller sold (what?) to the buyer sellerbuyer house seller sold house (to whom?) buyer bought house (from whom?)

N-nary Relationships seller buys a house from buyer sellerbuyer house

N-nary Relationships seller house buyer sale

Putting It Together ● OpenOffice Draw – Free / open source – Available in the lab – You can get “Crow’s Foot” templates at – Alternatively, do UML notation (“n..m”) by hand ● Microsoft Visio ● Your favorite software Options for software:

Questions?

course code title session code start date student last name first name room number capacity building code map url probably redundan t might be redundan t

course code title session code start date student last name first name room number capacity building code map url student enrolls in course course is offered in session course meets in room room is in building

course code title session code start date room number capacity building code map url student last name first name

course code title session code start date student last name first name room number capacity building code map url

course code title session code start date student last name first name room number capacity building code map url enrol lmen t

course code title session code start date student last name first name room number capacity building code map url enrol lmen t

course code title session code start date student last name first name room number capacity building code map url enrol lmen t cours e insta nce

course code title session code start date student last name first name room number capacity building code map url enrol lmen t cours e insta nce

course code title session code start date student last name first name room number capacity building code map url enrol lmen t cours e insta nce

course code title session code start date student last name first name room number capacity building code map url enrol lmen t cours e insta nce

course code title session code start date student last name first name room number capacity building code map url enrol lmen t cours e insta nce

course code title session code start date student last name first name room number capacity building code map url enrollment course instance final exam?

course code title session code start date student last name first name room number capacity building code map url enrollment course instance final exam?

Questions?