Download presentation
Presentation is loading. Please wait.
1
CITA 215 Section 3 Data Modeling
2
Essence of Data Modeling
Exploring the different ways that entities can relate to each other as they always do in the real world Devising a way of recording, of diagramming, the entities and the ways in which they interrelate in the business environment
3
Relational Database Model
Data stored as tables Relational databases have won the war between competing database models Conceptual simplicity Separation of logical organization from physical details Simple declarative language
4
Other Database Models Hierarchical Network Object-oriented XML
5
Relational Database Terminologies
Data is described in terms of entities, entity sets, attributes, and relationships. An entity is an object that can be distinguished from other objects. Examples: a book is an entity, a customer is an entity. Similar entities form entity sets. Examples: Books and Customers are entity sets if they represent a set of books and customers, respectively.
6
Relational Database Terminologies
Entities are characterized by properties called attributes. The unit price of a book is an attribute of the entity book. An entity must have one or more attributes. All entities in an entity set have the same attributes.
7
Relational Database Terminologies
Attributes have values associated with them. Example: the unit price of a book may have the value $29.95. Different attribute values distinguish similar entitles from each other. Many entities can have the same attribute value. Values of a subset of these attributes are used to distinguish entities in an entity set from each other. This set of attributes is called the key of the entity set.
8
Entity-Relationship (E-R) Model
A diagramming technique Diagrams entities (with attributes) and the relationship between the entities. There are many variations of E-R diagrams in use.
9
Relationships Associations between entities Different kinds:
Binary relationships Unary relationships Ternary relationships
10
Binary Relationships Simplest kind of relationship
Relationship between two entity types
11
Cardinality Represents the maximum number of entities that can be involved in a particular relationship. One-to-One Binary Relationship One-to-Many Binary Relationship Many-to-Many Binary Relationship
12
One-to-One Binary Relationship
1-1 A single occurrence of one entity type can be associated with a single occurrence of the other entity type and vice versa.
13
One-to-Many Binary Relationship
“many” = the maximum number of occurrences that can be involved, means a number that can be 1, 2, 3, ... n.
14
Many-to-Many Binary Relationship
M-M “many” can be either an exact number or have a known maximum.
15
Everest Books Tables Comments On Orders & OrderInfo Tables
Problem: In the Orders table, it would be nice to record each order as a single row. Unfortunately, orders can have variable number of books. variable number of columns. Tables cannot have a variable number of columns.
16
Typical Solution Shunt the variable items to another table whose rows are used for the variable number of items one per row. An id is used to identify the multiple rows in the new table with a single row in the original table. We will define a new table OrderInfo that will have a row for each book in an order, and each such row will have an id that associates it with the order in the Orders.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.