SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
INT306
Database Management Systems
DATABASE DESIGN & THE E-R MODEL
Text book

Database System Concepts
A. Silberschatz, H. F. Korth, S. Sudarshan

Course Instructor

Mr. Sumit Mittu

Assistant Professor and Placement Coordinator, CSE/IT
Lovely Professional University, Punjab (India)

sumit.12735@lpu.co.in sumit.mittu@gmail.com
http://tinyurl.com/askSumit
01-03-2014 11:42:06
IN THIS CHAPTER
•
•
•
•
•
•
•
•

data modelling
overview of database design process
entity-relationship model
constraints
removing redundant attributes in entity sets
entity-relationship diagram
reduction to relational schema
entity-relationship design issues

01-03-2014 11:42:07

Sumit Mittu, Assistant Professor, CSE/IT

2
DATA MODELS
• Data Model defined…
• Collection of conceptual tools for describing:
•
•
•
•

Data
Data relationships
Data semantics, and
Consistency constraints

• Types
• Object Based Logical data models
• Record Based Logical data models
• Physical data models
01-03-2014 11:42:07

Sumit Mittu, Assistant Professor, CSE/IT

3
DATA MODELS
Object based
Logical Models

Record based Logical Models
(Semantic)

(Semantic)

ER Model

01-03-2014 11:42:07

OO Model

Relational

Hierarchical

Sumit Mittu, Assistant Professor, CSE/IT

Network

Physical
Model

Unifying

4
DATA MODELLING
• A database can be modelled as:
• a collection of entities, and
• relationships among entities

• An entity:
• An object that exists and is distinguishable from other objects
• Example: specific person, company, event, plant

• Entities have attributes
• Example: people have names and addresses

• An entity set
• A set of entities of same type that share the same attributes
• Example: set of all persons, companies, trees, holidays
01-03-2014 11:42:07

Sumit Mittu, Assistant Professor, CSE/IT

5
DATABASE DESIGN PROCESS
• Creating a database involves:
• Design of database schema
• Design of programs that access and update the data
• Design of security scheme to control access to data
Design of
database
schema

01-03-2014 11:42:07

Design of
programs that
access and
update the data

Sumit Mittu, Assistant Professor, CSE/IT

Design of security
scheme to
control access to
data

6
DATABASE DESIGN PROCESS
• Design Phases
Collect User Requirements

• Fully characterize the needs of prospective
database users and domain experts

Choose Data Model

• Choose a data model and translate above
requirements into a conceptual schema

Specify Functional
Requirements

• Users describe the kinds of operations (or
transactions) to be performed on data

Review Conceptual
Schema

• Designer reviews conceptual schema to ensure
that it meets functional requirements

Physical Implementation
01-03-2014 11:42:07

• Logical design phase
• Physical design phase

Sumit Mittu, Assistant Professor, CSE/IT

7
DATABASE DESIGN PROCESS
• Pitfalls to avoid during database design process
Incompletenes
s
Redundancy

01-03-2014 11:42:08

Pitfalls
Sumit Mittu, Assistant Professor, CSE/IT

8
SCRATCH YOUR MIND!!!
•

•

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

9
THE ENTITY–RELATIONSHIP MODEL
• The E-R Model
• Perceives the real world as consisting of basic objects
(called entities) and relationships among them
• Represents overall logical design of the database
• A semantic model
• Useful in mapping the meanings and interactions of real
world enterprises onto conceptual schema

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

10
THE ENTITY–RELATIONSHIP MODEL
• The E-R Model
• Three basic concepts of E-R model
• Entity Sets
• Composed of entities

• Relationship Sets
• Composed of relationships

• Attributes
• Properties of entities (entity sets) and relationships (relationship sets)

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

11
THE ENTITY–RELATIONSHIP MODEL
• Entity

• A thing of an object in real world distinguishable from the
others

• E.g. each employee in an enterprise, each notebook, each wall

• Entity may be: concrete or abstract

• Entity Set

• Collection of entities with same set of properties/attributes

• E.g. Set of all employees in an enterprise, set all notebooks in a bag,
set of all walls in a building

• Individual entities that constitute a set are known as extension
of the entity set.
• Two or more entity sets may be disjoint (overlapping)

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

12
THE ENTITY–RELATIONSHIP MODEL

(Entities)

(Entity set)
(Entity set)
01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

13
THE ENTITY–RELATIONSHIP MODEL
• Attributes
• Each entity posses some properties whose values may help
identify an entity uniquely over a set of similar entities
• E.g. name/address of an employee, no. of pages in notebook,
height of a wall

• Each entity has a value for each of its attributes
• Domain or value-set of an attribute is the set of permissible
values for a given attribute for any entity.
• E.g. Age can be a positive integer above 18 for a voter entity.

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

14
Types of Attributes

THE ENTITY–RELATIONSHIP MODEL
Simple

Username, Password

Composite

Name composed of first name and last name

Single-valued

Registration No., Password

Multi-valued

Contact No., Subjects

Derived

Age derived from DoB

Null-valued

Criminal Record (that may not exist for some records)

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

15
THE ENTITY–RELATIONSHIP MODEL

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

16
THE ENTITY–RELATIONSHIP MODEL
• Relationship
• An association among several entities

• Relationship Set
• Set of relationships of same type
• Mathematically, it is a set R of ordered pairs set on n≥2
(possibly non-distinct) entity sets E1, E2, … En
• R = { (e1,e2,…en} | e1 є E1, e2 є E2, … en є En}

• Each ordered pair (e1,e2, … en) is a relationship

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

17
THE ENTITY–RELATIONSHIP MODEL

Each line above implies a relationship between entity
from instructor entity set and that from student entity set
01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

18
THE ENTITY–RELATIONSHIP MODEL
• Relationship Set
• Participation
• The association between entity sets in a relationship
• Types: Total or Partial

• Relationship instance
• An association between named entities

• Entity’s Role
• Function that entity plays in a relationship
• Types: Implicit or Explicit

• Recursive Relationship Set
• Entities of an entity set form relationship with other entities of same
entity set
01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

19
THE ENTITY–RELATIONSHIP MODEL
• Relationship
• Types (or degree of relationship):
• Binary (degree 2)
• Instructor, Student

• Ternary (degree 3)
• Instructor, Student, Course

• N-ary (degree N)
• Involving entities from N entity sets

• Descriptive attributes
• Attributes assigned to relationships
• Session Year attribute of Instructor-Student relationship

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

20
THE ENTITY–RELATIONSHIP MODEL

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

21
SCRATCH YOUR MIND!!!
•

•

•

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

22
CONSTRAINTS
• Mapping Cardinalities
• or, Cardinality ratios express the number of entities to which
another entity may be associated via a relationship set.
• Types
•
•
•
•

One to one
One to many
Many to one
Many to many

01-03-2014 11:42:08

1:1
1:N
N:1
M:N

Husbands :: Wives
Fathers :: Children
Children :: Mothers
Instructors :: Students

Sumit Mittu, Assistant Professor, CSE/IT

23
CONSTRAINTS

1:N

1:1
01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

24
CONSTRAINTS

M:N

N:1
01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

25
CONSTRAINTS
• Participation Constraints
• Total
• When all entities of an entity
participate in relationship set
• E.g. Entity Set A (in diagram)

• Partial
• When only some of the entities
participate in the relationship
set
• E.g. Entity Set B (in diagram)

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

26
KEYS
• Keys
• Help identify a set of attributes that suffice to distinguish
entities from each other
• Entity Set Keys
•
•
•
•

Super keys
Candidate Keys
Primary Key
Alternate Keys

• Relationship Set Keys
• PK(E1) u PK(E2) u … u PK(En) u {a1,a2,…am}
01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

27
REMOVING REDUNDANT ATTRIBUTES
• Database design using E-R Model
•
•
•
•

Identify the entity sets
Choose appropriate attributes
Form the relationship sets
Eliminate redundant attributes that may
• Exist in multiple entity sets
• E.g. instructor_id, instructor_dept_id and instructor_dept_name
repeated in instructor and student entity. The instructor_dept_id and
instructor_dept_name may be eliminated from student entity set

• Exist even when not actually required

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

28
SCRATCH YOUR MIND!!!
•

•

•

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

29
THE E-R DIAGRAMS
• E-R Diagram
• Graphical representation of the overall logical structure of
the database
• Basic Structure
•
•
•
•

Rectangles, Ellipses, Diamonds,
Lines, Dashed lines, Arrows
Double Lines, Double Diamonds, Double Ellipses
Link Labels (for cardinality and roles)

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

30
THE E-R DIAGRAMS
• E-R Diagram
• Weak entity sets
•
•
•
•

Identifying or owner entity set
Existence dependence
Identifying relationship
Discriminator attribute

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

31
01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

32
01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

33
01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

34
01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

35
THE E-R DIAGRAMS

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

36
THE E-R DIAGRAMS
• E-R Diagram Reduction to Relational Schema
•
•
•
•
•
•

Representation of Strong Entity Sets with simple attributes
Representation of Strong Entity Sets with complex attributes
Representation of Weak Entity Sets
Representation of Relationship Sets
Redundancy of Schemas
Combination of Schemas

01-03-2014 11:42:08

Sumit Mittu, Assistant Professor, CSE/IT

37
THE E-R DIAGRAMS
• E-R Diagram Design Issues
•
•
•
•

Use of entity sets v/s Attributes
Use of Entity Sets v/s Relationship Sets
Binary v/s n-ary relationships
Placement of Relationship Attributes

01-03-2014 11:42:06

Sumit Mittu, Assistant Professor, CSE/IT

38

Weitere ähnliche Inhalte

Was ist angesagt?

FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLEVraj Patel
 
Transaction management and concurrency control
Transaction management and concurrency controlTransaction management and concurrency control
Transaction management and concurrency controlDhani Ahmad
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Jargalsaikhan Alyeksandr
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFOum Saokosal
 
2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architectureKumar
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1smruti sarangi
 
Relational Algebra-Database Systems
Relational Algebra-Database SystemsRelational Algebra-Database Systems
Relational Algebra-Database Systemsjakodongo
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded searchHema Kashyap
 
Database Normalization
Database NormalizationDatabase Normalization
Database NormalizationArun Sharma
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional DependencyRaj Naik
 
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management systemPrerana Bhattarai
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalizationUniversity of Potsdam
 

Was ist angesagt? (20)

FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
Transaction management and concurrency control
Transaction management and concurrency controlTransaction management and concurrency control
Transaction management and concurrency control
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
Data Models
Data ModelsData Models
Data Models
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architecture
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1
 
Relational Algebra-Database Systems
Relational Algebra-Database SystemsRelational Algebra-Database Systems
Relational Algebra-Database Systems
 
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
NESTED SUBQUERY.pptx
NESTED SUBQUERY.pptxNESTED SUBQUERY.pptx
NESTED SUBQUERY.pptx
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded search
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional Dependency
 
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management system
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
 
ER MODEL
ER MODELER MODEL
ER MODEL
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Data mining primitives
Data mining primitivesData mining primitives
Data mining primitives
 

Andere mochten auch

Flow of accounting_entries_in_oracle_applications
Flow of accounting_entries_in_oracle_applicationsFlow of accounting_entries_in_oracle_applications
Flow of accounting_entries_in_oracle_applicationsSomasekhar Reddy
 
Database Management System And Design Questions
Database Management System And Design QuestionsDatabase Management System And Design Questions
Database Management System And Design QuestionsSamir Sabry
 
2009 Punjab Technical University B.C.A Database Management System Question paper
2009 Punjab Technical University B.C.A Database Management System Question paper2009 Punjab Technical University B.C.A Database Management System Question paper
2009 Punjab Technical University B.C.A Database Management System Question paperMonica Sabharwal
 
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAINFP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAINSyahriha Ruslan
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersAbdul Rahman Sherzad
 
Previous question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEBPrevious question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEBShabeeb Shabi
 
Internship Final Report
Internship Final Report Internship Final Report
Internship Final Report Nadia Nahar
 
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2Hsien-Hsin Sean Lee, Ph.D.
 

Andere mochten auch (18)

Int306 00
Int306 00Int306 00
Int306 00
 
Int306 03
Int306 03Int306 03
Int306 03
 
Int306 01
Int306 01Int306 01
Int306 01
 
Flow of accounting_entries_in_oracle_applications
Flow of accounting_entries_in_oracle_applicationsFlow of accounting_entries_in_oracle_applications
Flow of accounting_entries_in_oracle_applications
 
Oracle Forms
Oracle FormsOracle Forms
Oracle Forms
 
Int306 04
Int306 04Int306 04
Int306 04
 
Aca2 01 new
Aca2 01 newAca2 01 new
Aca2 01 new
 
Oracle installation
Oracle installationOracle installation
Oracle installation
 
Les 07 Rman Rec
Les 07 Rman RecLes 07 Rman Rec
Les 07 Rman Rec
 
Database Management System And Design Questions
Database Management System And Design QuestionsDatabase Management System And Design Questions
Database Management System And Design Questions
 
2009 Punjab Technical University B.C.A Database Management System Question paper
2009 Punjab Technical University B.C.A Database Management System Question paper2009 Punjab Technical University B.C.A Database Management System Question paper
2009 Punjab Technical University B.C.A Database Management System Question paper
 
Dbms Final Examination Answer Key
Dbms Final Examination Answer KeyDbms Final Examination Answer Key
Dbms Final Examination Answer Key
 
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAINFP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
 
Paper review
Paper reviewPaper review
Paper review
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and Answers
 
Previous question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEBPrevious question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEB
 
Internship Final Report
Internship Final Report Internship Final Report
Internship Final Report
 
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
 

Ähnlich wie Database Design & E-R Model

Entity relationship modelling - DE L300
Entity relationship modelling - DE L300Entity relationship modelling - DE L300
Entity relationship modelling - DE L300Edwin Ayernor
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSRubal Sagwal
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER DiagramsAdri Jovin
 
Cn presentation on the topic called as re modelling
Cn presentation on the topic called as re modellingCn presentation on the topic called as re modelling
Cn presentation on the topic called as re modellingg30162363
 
Database Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and HashingDatabase Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and HashingPrabu U
 
ICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdfICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdfInfotech27
 
Entity-Relationship Data Model
Entity-Relationship Data ModelEntity-Relationship Data Model
Entity-Relationship Data ModelBishrul Haq
 
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxDATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxJasmineMichael1
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxMaryJoseph79
 
Database architecture and Data modelling
 Database architecture and Data modelling Database architecture and Data modelling
Database architecture and Data modellingViswanathanS21
 
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.ppt
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.pptweek1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.ppt
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.pptRidoVercascade
 

Ähnlich wie Database Design & E-R Model (20)

Entity relationship modelling - DE L300
Entity relationship modelling - DE L300Entity relationship modelling - DE L300
Entity relationship modelling - DE L300
 
ERD.ppt
ERD.pptERD.ppt
ERD.ppt
 
ERD.ppt
ERD.pptERD.ppt
ERD.ppt
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
Database design
Database designDatabase design
Database design
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER Diagrams
 
Cn presentation on the topic called as re modelling
Cn presentation on the topic called as re modellingCn presentation on the topic called as re modelling
Cn presentation on the topic called as re modelling
 
Database Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and HashingDatabase Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and Hashing
 
ICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdfICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdf
 
lect2-model.ppt
lect2-model.pptlect2-model.ppt
lect2-model.ppt
 
Entity-Relationship Data Model
Entity-Relationship Data ModelEntity-Relationship Data Model
Entity-Relationship Data Model
 
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxDATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptx
 
Dbms 2: Data Model
Dbms 2: Data ModelDbms 2: Data Model
Dbms 2: Data Model
 
Database architecture and Data modelling
 Database architecture and Data modelling Database architecture and Data modelling
Database architecture and Data modelling
 
ER modeling
ER modelingER modeling
ER modeling
 
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.ppt
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.pptweek1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.ppt
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.ppt
 
Database design
Database designDatabase design
Database design
 
Database design
Database designDatabase design
Database design
 
Erd1
Erd1Erd1
Erd1
 

Mehr von Sumit Mittu

Mehr von Sumit Mittu (6)

Aca2 10 11
Aca2 10 11Aca2 10 11
Aca2 10 11
 
Aca2 09 new
Aca2 09 newAca2 09 new
Aca2 09 new
 
Aca2 08 new
Aca2 08 newAca2 08 new
Aca2 08 new
 
Aca2 07 new
Aca2 07 newAca2 07 new
Aca2 07 new
 
Aca2 06 new
Aca2 06 newAca2 06 new
Aca2 06 new
 
Aca11 bk2 ch9
Aca11 bk2 ch9Aca11 bk2 ch9
Aca11 bk2 ch9
 

Kürzlich hochgeladen

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Kürzlich hochgeladen (20)

Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 

Database Design & E-R Model

  • 1. INT306 Database Management Systems DATABASE DESIGN & THE E-R MODEL Text book Database System Concepts A. Silberschatz, H. F. Korth, S. Sudarshan Course Instructor Mr. Sumit Mittu Assistant Professor and Placement Coordinator, CSE/IT Lovely Professional University, Punjab (India) sumit.12735@lpu.co.in sumit.mittu@gmail.com http://tinyurl.com/askSumit 01-03-2014 11:42:06
  • 2. IN THIS CHAPTER • • • • • • • • data modelling overview of database design process entity-relationship model constraints removing redundant attributes in entity sets entity-relationship diagram reduction to relational schema entity-relationship design issues 01-03-2014 11:42:07 Sumit Mittu, Assistant Professor, CSE/IT 2
  • 3. DATA MODELS • Data Model defined… • Collection of conceptual tools for describing: • • • • Data Data relationships Data semantics, and Consistency constraints • Types • Object Based Logical data models • Record Based Logical data models • Physical data models 01-03-2014 11:42:07 Sumit Mittu, Assistant Professor, CSE/IT 3
  • 4. DATA MODELS Object based Logical Models Record based Logical Models (Semantic) (Semantic) ER Model 01-03-2014 11:42:07 OO Model Relational Hierarchical Sumit Mittu, Assistant Professor, CSE/IT Network Physical Model Unifying 4
  • 5. DATA MODELLING • A database can be modelled as: • a collection of entities, and • relationships among entities • An entity: • An object that exists and is distinguishable from other objects • Example: specific person, company, event, plant • Entities have attributes • Example: people have names and addresses • An entity set • A set of entities of same type that share the same attributes • Example: set of all persons, companies, trees, holidays 01-03-2014 11:42:07 Sumit Mittu, Assistant Professor, CSE/IT 5
  • 6. DATABASE DESIGN PROCESS • Creating a database involves: • Design of database schema • Design of programs that access and update the data • Design of security scheme to control access to data Design of database schema 01-03-2014 11:42:07 Design of programs that access and update the data Sumit Mittu, Assistant Professor, CSE/IT Design of security scheme to control access to data 6
  • 7. DATABASE DESIGN PROCESS • Design Phases Collect User Requirements • Fully characterize the needs of prospective database users and domain experts Choose Data Model • Choose a data model and translate above requirements into a conceptual schema Specify Functional Requirements • Users describe the kinds of operations (or transactions) to be performed on data Review Conceptual Schema • Designer reviews conceptual schema to ensure that it meets functional requirements Physical Implementation 01-03-2014 11:42:07 • Logical design phase • Physical design phase Sumit Mittu, Assistant Professor, CSE/IT 7
  • 8. DATABASE DESIGN PROCESS • Pitfalls to avoid during database design process Incompletenes s Redundancy 01-03-2014 11:42:08 Pitfalls Sumit Mittu, Assistant Professor, CSE/IT 8
  • 9. SCRATCH YOUR MIND!!! • • 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 9
  • 10. THE ENTITY–RELATIONSHIP MODEL • The E-R Model • Perceives the real world as consisting of basic objects (called entities) and relationships among them • Represents overall logical design of the database • A semantic model • Useful in mapping the meanings and interactions of real world enterprises onto conceptual schema 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 10
  • 11. THE ENTITY–RELATIONSHIP MODEL • The E-R Model • Three basic concepts of E-R model • Entity Sets • Composed of entities • Relationship Sets • Composed of relationships • Attributes • Properties of entities (entity sets) and relationships (relationship sets) 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 11
  • 12. THE ENTITY–RELATIONSHIP MODEL • Entity • A thing of an object in real world distinguishable from the others • E.g. each employee in an enterprise, each notebook, each wall • Entity may be: concrete or abstract • Entity Set • Collection of entities with same set of properties/attributes • E.g. Set of all employees in an enterprise, set all notebooks in a bag, set of all walls in a building • Individual entities that constitute a set are known as extension of the entity set. • Two or more entity sets may be disjoint (overlapping) 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 12
  • 13. THE ENTITY–RELATIONSHIP MODEL (Entities) (Entity set) (Entity set) 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 13
  • 14. THE ENTITY–RELATIONSHIP MODEL • Attributes • Each entity posses some properties whose values may help identify an entity uniquely over a set of similar entities • E.g. name/address of an employee, no. of pages in notebook, height of a wall • Each entity has a value for each of its attributes • Domain or value-set of an attribute is the set of permissible values for a given attribute for any entity. • E.g. Age can be a positive integer above 18 for a voter entity. 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 14
  • 15. Types of Attributes THE ENTITY–RELATIONSHIP MODEL Simple Username, Password Composite Name composed of first name and last name Single-valued Registration No., Password Multi-valued Contact No., Subjects Derived Age derived from DoB Null-valued Criminal Record (that may not exist for some records) 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 15
  • 16. THE ENTITY–RELATIONSHIP MODEL 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 16
  • 17. THE ENTITY–RELATIONSHIP MODEL • Relationship • An association among several entities • Relationship Set • Set of relationships of same type • Mathematically, it is a set R of ordered pairs set on n≥2 (possibly non-distinct) entity sets E1, E2, … En • R = { (e1,e2,…en} | e1 є E1, e2 є E2, … en є En} • Each ordered pair (e1,e2, … en) is a relationship 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 17
  • 18. THE ENTITY–RELATIONSHIP MODEL Each line above implies a relationship between entity from instructor entity set and that from student entity set 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 18
  • 19. THE ENTITY–RELATIONSHIP MODEL • Relationship Set • Participation • The association between entity sets in a relationship • Types: Total or Partial • Relationship instance • An association between named entities • Entity’s Role • Function that entity plays in a relationship • Types: Implicit or Explicit • Recursive Relationship Set • Entities of an entity set form relationship with other entities of same entity set 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 19
  • 20. THE ENTITY–RELATIONSHIP MODEL • Relationship • Types (or degree of relationship): • Binary (degree 2) • Instructor, Student • Ternary (degree 3) • Instructor, Student, Course • N-ary (degree N) • Involving entities from N entity sets • Descriptive attributes • Attributes assigned to relationships • Session Year attribute of Instructor-Student relationship 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 20
  • 21. THE ENTITY–RELATIONSHIP MODEL 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 21
  • 22. SCRATCH YOUR MIND!!! • • • 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 22
  • 23. CONSTRAINTS • Mapping Cardinalities • or, Cardinality ratios express the number of entities to which another entity may be associated via a relationship set. • Types • • • • One to one One to many Many to one Many to many 01-03-2014 11:42:08 1:1 1:N N:1 M:N Husbands :: Wives Fathers :: Children Children :: Mothers Instructors :: Students Sumit Mittu, Assistant Professor, CSE/IT 23
  • 26. CONSTRAINTS • Participation Constraints • Total • When all entities of an entity participate in relationship set • E.g. Entity Set A (in diagram) • Partial • When only some of the entities participate in the relationship set • E.g. Entity Set B (in diagram) 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 26
  • 27. KEYS • Keys • Help identify a set of attributes that suffice to distinguish entities from each other • Entity Set Keys • • • • Super keys Candidate Keys Primary Key Alternate Keys • Relationship Set Keys • PK(E1) u PK(E2) u … u PK(En) u {a1,a2,…am} 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 27
  • 28. REMOVING REDUNDANT ATTRIBUTES • Database design using E-R Model • • • • Identify the entity sets Choose appropriate attributes Form the relationship sets Eliminate redundant attributes that may • Exist in multiple entity sets • E.g. instructor_id, instructor_dept_id and instructor_dept_name repeated in instructor and student entity. The instructor_dept_id and instructor_dept_name may be eliminated from student entity set • Exist even when not actually required 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 28
  • 29. SCRATCH YOUR MIND!!! • • • 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 29
  • 30. THE E-R DIAGRAMS • E-R Diagram • Graphical representation of the overall logical structure of the database • Basic Structure • • • • Rectangles, Ellipses, Diamonds, Lines, Dashed lines, Arrows Double Lines, Double Diamonds, Double Ellipses Link Labels (for cardinality and roles) 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 30
  • 31. THE E-R DIAGRAMS • E-R Diagram • Weak entity sets • • • • Identifying or owner entity set Existence dependence Identifying relationship Discriminator attribute 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 31
  • 32. 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 32
  • 33. 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 33
  • 34. 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 34
  • 35. 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 35
  • 36. THE E-R DIAGRAMS 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 36
  • 37. THE E-R DIAGRAMS • E-R Diagram Reduction to Relational Schema • • • • • • Representation of Strong Entity Sets with simple attributes Representation of Strong Entity Sets with complex attributes Representation of Weak Entity Sets Representation of Relationship Sets Redundancy of Schemas Combination of Schemas 01-03-2014 11:42:08 Sumit Mittu, Assistant Professor, CSE/IT 37
  • 38. THE E-R DIAGRAMS • E-R Diagram Design Issues • • • • Use of entity sets v/s Attributes Use of Entity Sets v/s Relationship Sets Binary v/s n-ary relationships Placement of Relationship Attributes 01-03-2014 11:42:06 Sumit Mittu, Assistant Professor, CSE/IT 38