0% found this document useful (0 votes)
90 views21 pages

Data Modeling - I: Business Information Systems

This document provides an overview of data modeling concepts including: - A data model specifies data structures and business rules to represent requirements. Entities represent objects about which data is stored, with attributes defining their characteristics. - Keys uniquely identify entity instances. Primary keys are single or composite attributes chosen to uniquely identify each record. Surrogate keys are artificial attributes used to replace long composite keys. - Relationships represent logical links between entities, with cardinality defining whether relationships are one-to-one, one-to-many, or many-to-many. - Foreign keys in child entities reference primary keys in parent entities to link related records while maintaining referential integrity rules on changes.

Uploaded by

shashank_u
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views21 pages

Data Modeling - I: Business Information Systems

This document provides an overview of data modeling concepts including: - A data model specifies data structures and business rules to represent requirements. Entities represent objects about which data is stored, with attributes defining their characteristics. - Keys uniquely identify entity instances. Primary keys are single or composite attributes chosen to uniquely identify each record. Surrogate keys are artificial attributes used to replace long composite keys. - Relationships represent logical links between entities, with cardinality defining whether relationships are one-to-one, one-to-many, or many-to-many. - Foreign keys in child entities reference primary keys in parent entities to link related records while maintaining referential integrity rules on changes.

Uploaded by

shashank_u
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 21

Business Information Systems

Data Modeling - I

What is a Data Model?

DATA MODEL

The specification of data structures and business rules to represent business requirements.

STUDENT
student id student last name student first name student major

COURSE
course id

attends/ is taught to

course title course number of credits course instructor name

Entities
ENTITY
A person, place, thing, event, or concept about which the business keeps data.

Each entity should be fully defined by the business community to:


Identify why the business needs this information Improve understanding Avoid redundancy

Each ENTITY should be named using:


Unique entity names in a model A non-technical, business-like name A singular noun that describes a singular instance (no collective nouns)

Defining the Entity


Each ENTITY represents a set/collection of like individual objects called instances. Two types of entities:

Independent: depends on no other entity for its identification

ORDER

Dependent: depends on one or more entities for its identification

LINE ITEM

Attributes
ATTRIBUTE
A distinct characteristic of an ENTITY for which data is maintained.

Attribute Names :
ENTITY Name (above the box)

Unique attribute names in a


model (or entity) A non-technical, businesslike name A singular noun that describes a singular instance (no collective nouns) All lowercase (Erwin standard), with spaces

EMPLOYEE

employee id employee employee employee employee first name last name address phone number

attributes

Attribute Types
Two types of attributes:

Key Non-key

Key Attribute(s) (above the line)

CONSULTANT

Non-Key Attribute(s) (below the line)

consultant id consultant first name consultant last name consultant specialization consultant hourly rate

How do we determine keys?

CANDIDATE KEY
Any attribute or group of attributes which serves to uniquely identify each instance of an ENTITY.
BOOK
author first name author last name book title book edition book publisher book year published book isbn book lc catalog number

BOOK
author first name author last name book title book edition book publisher book year published book isbn book lc catalog number

BOOK
author first name author last name book title book edition book publisher book year published book isbn book lc catalog number

Primary Keys
PRIMARY KEY An ATTRIBUTE or group of attributes that uniquely identifies an instance of the entity.

BOOK

book isbn
author first name author last name book title book edition book publisher book year published book lc catalog number

Factors to consider:

The primary key is always placed above the line in an Entity

Should be efficient Must not contain any null parts Values must remain static Should be a data element in your control

Surrogate Keys
SURROGATE KEY
A contrived, non-intelligent, single-attribute key used to replace a long composite key.

CASH MACHINE TRANSACTION

CASH MACHINE TRANSACTION

account id customer id cash machine id transaction date

transaction id account id customer id cash machine id transaction date

Composite Key

Surrogate Key

10

The story so far


An entity is something about which we want to store information Entities are identified through the system analysis process An entity has attributes which are also identified during system analysis process Information about an entity is stored in values of the attributes Key attributes identify an instance of an entity uniquely If there are more than one key attribute they are called candidate keys Based on the application one of them is chosen as the primary key If it is not possible to have a single attribute as the key attribute,

the primary key is created as a composite of 2 or more non key attributes or a single but new and artificial attribute called surrogate key is created

11

Relationships

RELATIONSHIP A logical link between two entities that represents a business rule or constraint.
MOVIE
is rented as

MOVIE COPY

12

Relationships
1:1 One to one mandatory; One student has one address 1:N One to many mandatory ; A customer having multiple addresses 1:1 One to one optional; An employee may or may not have a spouse 1:N One to many optional; One order having many order items M:N many to many; Many parts being supplied by many suppliers

PART

is ordered from/sends us

SUPPLIER

13

Relationship Cardinality
places

CUSTOMER

ORDER

A customer places zero, one, or more orders. An order relates to only one customer. STUDENT
has

BOOK

Each student has one or more books. A book is with one student
is ticketed for

AIRPLANE SEAT

PASSENGER

Each seat will seat zero or one passenger. One passenger can sit on only one seat.

CAR
Each car has exactly N tyres

requires N

TYRE

14

Creating ER Diagram
Identify and list all the entities of the system For each entity list the attributes Identify the candidate keys and choose the primary key based on the application For each pair of entities, decide if there is a relationship If there is a relationship, decide what kind Use tools like Visio to draw the ER Diagram Discuss the ER model with end users (walkthrough)

15

Relationship Rules
1:1 mandatory; this means that both are parts of larger entity; One entity is merged with the other to create an entity which has attributes of both entities 1: 1 optional; primary key of one entity is placed as attribute of the entity which is optional 1:n optional/ mandatory; primary key of singular entity is placed as an additional attribute in the entity that can have multi occurrences N:M; create new artificial entity which has primary key of both original entities as attributes

16

OMS
Product
N M

Order
N M

Customer

Product

Order
N M

Customer

Order Item

Note: For clarity in understanding the type of relationship, the relationship names are not metioned in this diagram

17

Foreign Keys

FOREIGN KEY (FK)

A primary key of a parent entity that is contributed to a child entity across a relationship.
ORDER
order number order date order sales representative order customer
contains

LINE ITEM order number (FK) line item sequence number product code line item quantity line item number line item description

Referential Integrity : What & Why ?


REFERENTIAL INTEGRITY (RI) Rules that determine what happens when a Parent or Child instance is inserted, updated or deleted.
What is the impact of:

Inserting, updating, or deleting a Parent Primary Key value? Inserting, updating, or deleting a Child Foreign Key value?

None of these actions should break the relationship from Child to Parent Options can be specified as to how the DBMS should manage these actions to maintain referential integrity 18

Exercise
Identify the entity, attributes and the key
ORDER
Order Date Customer Name Customer Address Customer Credit Rating Order Value Item 1 Desc Item 1 unit price Item 1 quantity Item 1 Deliver Date Item 2 Desc Item 2 unit price Item 2 quantity Item 2 Deliver Date

Apply the ER diagram rules for the data model of a library system Supplier
N M

Parts
N M

Product

Next Class
Data Normalization

You might also like