SlideShare a Scribd company logo
1 of 56
1.1 Introduction1.1 Introduction
Traditional database applications
New applications: multimedia databases,
geographic information system,
data warehouses, …
Database: A collection of related data.
Data: Known facts that can be recorded and have an
implicit meaning.
(e.g., names, telephone numbers, addresses, …)
(indexed address book, diskette, …)
1-21-2 1-1-11
1-2
1-2
Database Management System(DBMS): A software
package to facilitate the creation and maintenance of a
computerized database.
˙Defining ˙Constructing ˙Manipulating
Database System: The DBMS software together with the
data itself.
Mini-world (Universe of Discourse): Some part of the real
world about which data is stored in a database. For example,
student grades and transcripts at a university.
• Library card catalog: generated & maintained manually
• Computerized database
1-3
1-5a
Define UNIVERSITY databaseDefine UNIVERSITY database
Structure of the record
STUDENT ( Name , Number, Class, Major)
COURSE ( Name , Number, Credit, Dept.)
Data type of data element
Name: a string of characters
Number: integer
Grade: {A,B,C,D,F,I}
…..
Constraints
The sections that students take must be taught by some instructors.
1-4
1-5b
Construct UNIVERSITY databaseConstruct UNIVERSITY database
Store data on storage medium
˙store data for each student, course, section, grade repot, prerequisite
˙records in various files may be related to one another
Manipulate UNIVERSITY databaseManipulate UNIVERSITY database
Query:
Retrieve the transcript ( a list of all courses and grades) of Smith.
Update:
Create a new section for the database course for this semester.
1-5
1-3
Figure 1.1 A simplified database system environment
1-6
1-4
1.2 An Example1.2 An Example
Mini-world for the example: Part of a UNIVERSITY environment.
Some mini-world entities:
- STUDENTs
- COURSEs
- SECTIONs (of COURSEs)
- (academic) DEPARTMENTs
- INSTRUCTORs
Some mini-world relationships:
- SECTIONs are of specific COURSEs
- STUDENTs take SECTIONs
- COURSEs have prerequisite COURSEs
- INSTRUCTORs teach SECTIONs
- COURSEs are offered by DEPARTMENTs
- STUDENTs major in DEPARTMENTs
7
Entity-Relationship Model
 A logical representation of the data for an organization
or for a business area
 3 constructs:
 Entity - person, place, object, event, concept (often
corresponds to a row in a table)
 Attribute - property or characteristic of an entity (often
corresponds to a field in a table)
 Relationship – link between entities (corresponds to primary
key-foreign key equivalencies in related tables)
 Type vs. instance
• Entity type: Instructor
• Entity instance: Leon Chen
 Entity-Relationship Diagram
 A graphical representation of entity-relationship model
 Also called E-R diagram or just ERD
STUDENT
Name
Registers
8
Sample E-R Diagram (Figure 3-1)
Supplier_ID
Supplier_Name
Supplier_Address
Attribute
9
Relationship
degrees specify
number of entity
types involved
Entity
symbols
A special entity
that is also a
relationship
Relationship
symbols
Relationship
cardinalities
specify how
many of each
Attribute
symbols
10
Entity
 Person: EMPLOYEE, STUDENT
 Place: WAREHOUSE, COUNTRY
 Object: BUILDING, MACHINE
 Event: SALE, REGISTRATION
 Concept: ACCOUNT, COURSE
EMPLOYEE DEPENDENT
Strong entity Weak entity
Associative entity
CERTIFICATE
11
What Should an Entity Be?
 SHOULD BE:
 An object that will have many instances in
the database
 An object that will be composed of multiple
attributes
 An object that we are trying to model
 SHOULD NOT BE:
 A user of the database system
 An output of the database system (e.g. a
report)
12
Inappropriate entities
System userSystem user System outputSystem output
Appropriate entities
Figure 3-4
13
Attribute
 Attribute - property or characteristic of an
entity type
 Classifications of attributes:
 Required vs. Optional Attributes
 Simple vs. Composite Attribute
 Single-Valued vs. Multivalued Attribute
 Stored vs. Derived Attributes
 Identifier Attributes - keys
14
Required vs. Optional Attributes
 Example: entity – ONLINE_ACCOUNT
 Required attributes (Not NULL)
• Account_ID
• Password
• Owner_Name
 Optional attributes
• Phone_Number
• Password_Hint
15
Figure 3-7 – A composite attribute
An attribute
broken into
component parts
16
Figure 3-8 – Entity with a multivalued attribute (Skill) and
derived attribute (Years_Employed)
Derived
from date employed and current date
Multivalued:
an employee can have
more than one skill
17
Figure 3-19 – An attribute that is both multivalued and composite
This is an example of
time-stamping.
More examples?
18
Identifiers (Keys)
 Identifier (Key) - An attribute (or
combination of attributes) that uniquely
identifies individual instances of an entity
type
 Candidate Key – an attribute that could be
a key. Examples (for STUDENT,
PERSON)?
 Simple Key versus Composite Key
19
Figure 3-9a Simple key attribute
The key is underlined
20
Figure 3-9b Composite key attribute
Flight_Number Date
21
Guidelines for Identifiers
 Will not change in value
 Will not be null
 Substitute new, simple keys for long,
composite keys
 ?  Game_Number
22
Relationship
 Relationship Type vs. Relationship
Instance
 Degree of a relationship
 Cardinality of a relationship
 Associative Entity – combination of
relationship and entity
23
Figure 3-11a
The relationship type is modeled as the
diamond and lines between entity types
attribute of the relationship
24
Relationship Instance is between
specific entity instances
25
One entity
related to
another of
the same
entity type
Entities of
two different
types related
to each other Entities of three
different types
related to each
other
Degree of a relationship is the number
of entity types that participate in it
26
Cardinality of a Relationship
 One-to-One
 Each entity in the relationship will have exactly one
related entity
 One-to-Many
 An entity on one side of the relationship can have
many related entities, but an entity on the other side
will have a maximum of one related entity
 Many-to-Many
 Entities on both sides of the relationship can have
many related entities on the other side
27
28
29
Note: a relationship can have attributes of its own
30
Cardinality Constraints
 Cardinality Constraints - the number of instances
of one entity that can or must be associated with
each instance of another entity
 Minimum Cardinality. Examples?
 If zero, then optional
 If one or more, then mandatory
 Maximum Cardinality. Examples?
 The maximum number
31
Cardinalities
Mandatory one
Mandatory many
Optional one
Optional many
11
18
32
Figure 3-16a Basic relationship
Mandatory minimum cardinalities – Figure 3-17a
33
Figure 3-17c
Optional cardinalities with unary degree, one-to-one relationship
34
max cardinality
constraint
Maximum Cardinality Constraint
35
Entities can be related to one another in more than one way
36
Attributes can be transformed to relationships
Attributes or Relationship?
37
Attributes should be transformed to relationships
Attributes or Relationship?
38
Associative Entities

It’s an entity – it has attributes

AND it’s a relationship – it links entities together
 When should a relationship with attributes be an
associative entity?
 All relationships for the associative entity should be many
 The associative entity could have meaning independent of the
other entities
 The associative entity should have at least one or more
attributes other than the identifier
 The associative entity may participate in other relationships
other than the entities of the associated relationship
 Ternary relationships should be converted to associative
entities
39Figure 3-11b – An associative entity (CERTIFICATE)
40
Bill of materials structure
41
Figure 3-18 – Ternary relationship as an associative entity
42
Strong vs. Weak Entities
 Strong entities
 exist independently of other types of entities
 has its own unique identifier
 represented with single-line rectangle
 Weak entity
 dependent on a strong entity…cannot exist on its own
 does not have a unique identifier
 represented with double-line rectangle
 Identifying relationship
 links strong entities to weak entities
 represented with double line diamond
43
Strong entity Weak entityIdentifying relationship
44
Figure 3-22a
E-R diagram for Pine
Valley Furniture
45
Microsoft Visio
Notation for Pine
Valley Furniture
Different modeling
software tools may
have different
notation for the
same constructs
46
Relationship
degrees specify
number of entity
types involved
Entity
symbols
A special entity
that is also a
relationship
Relationship symbols
Relationship
cardinalities
specify how
many of each
Attribute symbols
47
Sample E-R Diagram (Figure 3-1)
Supplier_ID
Supplier_Name
Supplier_Address
Attribute
48
E-R Diagram for a
Banking Enterprise
Library Case Study
 When a library first receives a book from a publisher it is sent,
together with the accompanying delivery note, to the library desk.
Here the delivery note is checked against a file of books ordered.
 If no order can be found to match the note, a letter of enquiry is sent
to the publishers. If a matching order is found, a catalogue note is
prepared from the details on the validated delivery note.
 The catalogue note, together with the book, is sent to the
registration department. The validated delivery note is sent to the
accounts department where it is stored.
 On receipt of an invoice from the publisher, the accounts
department checks its store of delivery notes. If the corresponding
delivery note is found then an instruction to pay the publishers is
made, and subsequently a cheque is sent. If no corresponding
delivery note is found, the invoice is stored in a pending file. 
A Case Study
Conference centre booking system
A conference centre takes bookings from clients who wish to hold courses or conferences at the
centre. When clients make bookings they specify how many people are included in the booking,
and of these, how many will be resident during the booking, and how many will require catered or
non-catered accommodation at the centre.
The centre contains a number of facilities which may be required by clients making bookings as
follows:
A. There are 400 bedrooms for clients who will be resident during the Course or
conference.
B. A maximum of 250 catered people can be handled at any one time.
C. Six main lecture theatres providing seating for 200 people.
D. Twenty seminar rooms each able to accommodate 25 people.
E. Video conference facilities. The video conference facilities consist of four separate
video conference networks. Each video conference network has a large screen based
in one of the main lecture theatres, along with 3 satellite screens each of which is
based in one of the seminar rooms.
Draw an entity relationship diagram for the case, stating any assumptions you deem necessary.
Shipping company example
 The London and Ireland Shipping Company PLC (LISC) was founded in 1852 and owns a fleet of cargo ships.
The company had historically run passenger liners, but recent policy decisions involved the sale of all passenger-
carrying vessels. The company currently has 14 vessels, including one oil tanker and one tugboat operating out of
Liverpool. Most of the vessels are registered in Liberia for tax reasons.
 Each ship has one or more holds divided into spaces. The holds are defined by steel bulkheads and the spaces
are defined by shelf racks or other physical dividers. Sister ships, built by the same shipbuilders and to the same
designs have similar names, such as Pride of Ireland, Queen of Ireland, Song of Ireland and Warrior of Ireland.
Sister ships also have identical cargo storage facilities.
 LISC issues contracts to agents for one or more manifests (lists of cargo items to be shipped). LISC's charges for
cargo carried are based on the number of spaces the cargo requires for storage. The types of cargo typically
carried by LISC include grain, coal and ores (carried only in ships equipped with bulk cargo holds). They also
transport sacked grain, heavy cases, containers (which may be carried on deck), pallets and so on.
 Cargo items may take up less than one space in a hold, or one or more spaces, depending on the size of the
item. A space may therefore contain several small cargo items.
 The ships owned by LISC are kept as busy and as full as possible, in order to maximise the profits that each
vessel makes and minimise running & operating costs. LISC's ships ply most of the seas of the world, but tend to
operate mainly in the Mediterranean, the North and Mid Atlantic and the Indian Ocean. Different ships require
different crew complements.
 LISC intends to create a computer based information system that will be able to perform the following tasks:
 • record the voyages of each ship with the start and end ports.
 • record the cargo held by a ship on each voyage
 • keep records of their employees and the ships they are assigned to
 • producing invoices for agents and customers
 • keep a record of customers' payments on invoices
 • analyse the efficiency of use of cargo space and of percentage wasted cargo space for ships voyages
1-52
1-6
1.3 Characteristics of the Database Approach1.3 Characteristics of the Database Approach
• File Processing
Each user defines and implements the files needed for a specific application
Redundancy in defining & storing data
• Database Approach
A single repository of data
-Self-describing nature of a database system: A DBMS catalog stores the
description of the database. The description is called meta-data . This allows the
DBMS software to work with different databases.
catalog: structure of each file, type & storage format of each data item, constraints on
data
-Insulation between programs and data: Called program-data independence.
Allows changing data storage structures without having to change the DBMS access
programs.(see 1-7)
program–
Interface + method
operation independence (OODB)
1-53
1-11
1.6 Advantages of Using a DBMs1.6 Advantages of Using a DBMs
1.6.1 Controlling Redundancy in data storage and in development and
maintenance efforts.
duplication efforts waste space inconsistent‧ ‧ ‧
( see 1-12 controlled redundancy)
1.6.2 Restricting Unauthorized Access (security and authorization)
1.6.3 Providing Persistent Storage for Program Objects and Data
Structures.
1.6.4 Permitting Inferencing and Actions Using Rules
1.6.5 Providing Multiple User Interfaces
1.6.6 Representing Complex Relationships Among data.
1.6.7 Enforcing Integrity Constraints
1.6.8 Providing Backup and Recovery
1-54
1-11
-Potential for Enforcing Standards.
-Reduced Application Development Time.
-Flexibility.
-Availability of Up-to-date Information.
-Economies of Scale.
1.7 Implications of the1.7 Implications of the DatabaseDatabase ApproachApproach
1-55
1-13
1.8 When not to use a DBMS1.8 When not to use a DBMS
Main costs of using a DBMS:
- High initial investment in hardware, software,training
and possible need for additional hardware.
- Overhead for providing generality, security, recovery, integrity, and
concurrency control.
- Generality that a DBMS provides for defining and processing data.
When a DBMS may be unnecessary:
- If the database and applications are simple, well defined, and not
expected to change.
- If there are stringent real-time requirements that may not be met
because of DBMS overhead.
- If access to data by multiple users is not required.
Summary
In today’s session we have learned
to:
Identify the entities
Determine the attributes for each entity
Select the primary key for each entity
Establish the relationships between the
entities
Draw an entity model

More Related Content

What's hot

Inner join and outer join
Inner join and outer joinInner join and outer join
Inner join and outer joinNargis Ehsan
 
The Traditional Approach to Requirement
The Traditional Approach to RequirementThe Traditional Approach to Requirement
The Traditional Approach to RequirementHenhen Lukmana
 
Linear Search & Binary Search
Linear Search & Binary SearchLinear Search & Binary Search
Linear Search & Binary SearchReem Alattas
 
Enterprise Green IT strategy
Enterprise Green IT strategyEnterprise Green IT strategy
Enterprise Green IT strategyRanjana Gore
 
Cooling Optimization 101: A Beginner's Guide to Data Center Cooling
Cooling Optimization 101: A Beginner's Guide to Data Center CoolingCooling Optimization 101: A Beginner's Guide to Data Center Cooling
Cooling Optimization 101: A Beginner's Guide to Data Center CoolingUpsite Technologies
 
Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IMohamed Loey
 
Introduction to Computer graphics
Introduction to Computer graphicsIntroduction to Computer graphics
Introduction to Computer graphicsLOKESH KUMAR
 
10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMSkoolkampus
 
Data warehouse and data mining
Data warehouse and data miningData warehouse and data mining
Data warehouse and data miningPradnya Saval
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Muhammad Hammad Waseem
 
Relationship Types of degree higher than 2
Relationship Types of degree higher than 2Relationship Types of degree higher than 2
Relationship Types of degree higher than 2Aadesh Shrestha
 
UNIT III NON LINEAR DATA STRUCTURES – TREES
UNIT III 	NON LINEAR DATA STRUCTURES – TREESUNIT III 	NON LINEAR DATA STRUCTURES – TREES
UNIT III NON LINEAR DATA STRUCTURES – TREESKathirvel Ayyaswamy
 
Mapping ER and EER Model
Mapping ER and EER ModelMapping ER and EER Model
Mapping ER and EER ModelMary Brinda
 
Radix and Merge Sort
Radix and Merge SortRadix and Merge Sort
Radix and Merge SortGelo Maribbay
 

What's hot (20)

Inner join and outer join
Inner join and outer joinInner join and outer join
Inner join and outer join
 
Chap05 c
Chap05 cChap05 c
Chap05 c
 
Avl trees
Avl treesAvl trees
Avl trees
 
The Traditional Approach to Requirement
The Traditional Approach to RequirementThe Traditional Approach to Requirement
The Traditional Approach to Requirement
 
Linear Search & Binary Search
Linear Search & Binary SearchLinear Search & Binary Search
Linear Search & Binary Search
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
Enterprise Green IT strategy
Enterprise Green IT strategyEnterprise Green IT strategy
Enterprise Green IT strategy
 
parallel Merging
parallel Mergingparallel Merging
parallel Merging
 
Cooling Optimization 101: A Beginner's Guide to Data Center Cooling
Cooling Optimization 101: A Beginner's Guide to Data Center CoolingCooling Optimization 101: A Beginner's Guide to Data Center Cooling
Cooling Optimization 101: A Beginner's Guide to Data Center Cooling
 
Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms I
 
Introduction to Computer graphics
Introduction to Computer graphicsIntroduction to Computer graphics
Introduction to Computer graphics
 
10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMS
 
Data warehouse and data mining
Data warehouse and data miningData warehouse and data mining
Data warehouse and data mining
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]
 
Relationship Types of degree higher than 2
Relationship Types of degree higher than 2Relationship Types of degree higher than 2
Relationship Types of degree higher than 2
 
UNIT III NON LINEAR DATA STRUCTURES – TREES
UNIT III 	NON LINEAR DATA STRUCTURES – TREESUNIT III 	NON LINEAR DATA STRUCTURES – TREES
UNIT III NON LINEAR DATA STRUCTURES – TREES
 
Unit05 dbms
Unit05 dbmsUnit05 dbms
Unit05 dbms
 
5desc
5desc5desc
5desc
 
Mapping ER and EER Model
Mapping ER and EER ModelMapping ER and EER Model
Mapping ER and EER Model
 
Radix and Merge Sort
Radix and Merge SortRadix and Merge Sort
Radix and Merge Sort
 

Viewers also liked

The Internet, Intranet and Extranet
The Internet, Intranet and ExtranetThe Internet, Intranet and Extranet
The Internet, Intranet and ExtranetFellowBuddy.com
 
Advertising and sales promotion question paper
Advertising and sales promotion question paperAdvertising and sales promotion question paper
Advertising and sales promotion question paperVishal Milwani
 
Business etiquette 1
Business etiquette 1Business etiquette 1
Business etiquette 1leslie_realm
 
Choosing an eLearning Provider
Choosing an eLearning ProviderChoosing an eLearning Provider
Choosing an eLearning Providerej4video
 
Persuasion Skills Basics
Persuasion Skills BasicsPersuasion Skills Basics
Persuasion Skills BasicsFellowBuddy.com
 
Microsoft Office PowerPoint 2007 Training
Microsoft Office PowerPoint 2007 TrainingMicrosoft Office PowerPoint 2007 Training
Microsoft Office PowerPoint 2007 TrainingFellowBuddy.com
 
Chapter01 introduction
Chapter01 introductionChapter01 introduction
Chapter01 introductionNgeam Soly
 
General etiquette presentation by fola daniel adelesi
General etiquette presentation by fola daniel adelesiGeneral etiquette presentation by fola daniel adelesi
General etiquette presentation by fola daniel adelesiFola Daniel Adelesi
 
Choosing an e learning provider combined edits 092413 (final) (1)
Choosing an e learning provider combined edits 092413 (final) (1)Choosing an e learning provider combined edits 092413 (final) (1)
Choosing an e learning provider combined edits 092413 (final) (1)ej4video
 
Event scotland guide
Event scotland guideEvent scotland guide
Event scotland guideIoana Abrudan
 
Project Management System
Project Management SystemProject Management System
Project Management SystemDivyen Patel
 
Event Management Professional
Event Management ProfessionalEvent Management Professional
Event Management ProfessionalMohammad Sharkawy
 
Business Plan Training Session 5 Management
Business Plan Training Session 5   ManagementBusiness Plan Training Session 5   Management
Business Plan Training Session 5 Managementcbehn1
 
Business Plan Training Session 3: Competition
Business Plan Training Session 3: CompetitionBusiness Plan Training Session 3: Competition
Business Plan Training Session 3: Competitioncbehn1
 
Bsc cs ii-dbms- u-i-database systems
Bsc cs ii-dbms- u-i-database systemsBsc cs ii-dbms- u-i-database systems
Bsc cs ii-dbms- u-i-database systemsRai University
 
Event management 2nd Lecture in sports facilities
Event management 2nd Lecture in sports facilitiesEvent management 2nd Lecture in sports facilities
Event management 2nd Lecture in sports facilitiesUsman Khan
 
Enterprise Architecture Framework: Chase Global Bank
Enterprise Architecture Framework: Chase Global BankEnterprise Architecture Framework: Chase Global Bank
Enterprise Architecture Framework: Chase Global BankHampus Ahlqvist
 

Viewers also liked (20)

Normalization
NormalizationNormalization
Normalization
 
The Internet, Intranet and Extranet
The Internet, Intranet and ExtranetThe Internet, Intranet and Extranet
The Internet, Intranet and Extranet
 
Advertising and sales promotion question paper
Advertising and sales promotion question paperAdvertising and sales promotion question paper
Advertising and sales promotion question paper
 
Ch 3 E R Model
Ch 3  E R  ModelCh 3  E R  Model
Ch 3 E R Model
 
Business etiquette 1
Business etiquette 1Business etiquette 1
Business etiquette 1
 
Choosing an eLearning Provider
Choosing an eLearning ProviderChoosing an eLearning Provider
Choosing an eLearning Provider
 
Persuasion Skills Basics
Persuasion Skills BasicsPersuasion Skills Basics
Persuasion Skills Basics
 
Microsoft Office PowerPoint 2007 Training
Microsoft Office PowerPoint 2007 TrainingMicrosoft Office PowerPoint 2007 Training
Microsoft Office PowerPoint 2007 Training
 
Chapter01 introduction
Chapter01 introductionChapter01 introduction
Chapter01 introduction
 
General etiquette presentation by fola daniel adelesi
General etiquette presentation by fola daniel adelesiGeneral etiquette presentation by fola daniel adelesi
General etiquette presentation by fola daniel adelesi
 
Interviewing skills
Interviewing skillsInterviewing skills
Interviewing skills
 
Choosing an e learning provider combined edits 092413 (final) (1)
Choosing an e learning provider combined edits 092413 (final) (1)Choosing an e learning provider combined edits 092413 (final) (1)
Choosing an e learning provider combined edits 092413 (final) (1)
 
Event scotland guide
Event scotland guideEvent scotland guide
Event scotland guide
 
Project Management System
Project Management SystemProject Management System
Project Management System
 
Event Management Professional
Event Management ProfessionalEvent Management Professional
Event Management Professional
 
Business Plan Training Session 5 Management
Business Plan Training Session 5   ManagementBusiness Plan Training Session 5   Management
Business Plan Training Session 5 Management
 
Business Plan Training Session 3: Competition
Business Plan Training Session 3: CompetitionBusiness Plan Training Session 3: Competition
Business Plan Training Session 3: Competition
 
Bsc cs ii-dbms- u-i-database systems
Bsc cs ii-dbms- u-i-database systemsBsc cs ii-dbms- u-i-database systems
Bsc cs ii-dbms- u-i-database systems
 
Event management 2nd Lecture in sports facilities
Event management 2nd Lecture in sports facilitiesEvent management 2nd Lecture in sports facilities
Event management 2nd Lecture in sports facilities
 
Enterprise Architecture Framework: Chase Global Bank
Enterprise Architecture Framework: Chase Global BankEnterprise Architecture Framework: Chase Global Bank
Enterprise Architecture Framework: Chase Global Bank
 

Similar to Database Management System

chapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdfchapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdfMisganawAbeje1
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Modeloudesign
 
Basic concepts of Data and Databases
Basic concepts of Data and Databases Basic concepts of Data and Databases
Basic concepts of Data and Databases Tharindu Weerasinghe
 
Use analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptxUse analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptxMwangaPrayGod
 
Dbms ii mca-ch3-er-model-2013
Dbms ii mca-ch3-er-model-2013Dbms ii mca-ch3-er-model-2013
Dbms ii mca-ch3-er-model-2013Prosanta Ghosh
 
Chapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptxChapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptxsantosh96234
 
ER Model and other topics in DBMS
ER Model and other topics in DBMSER Model and other topics in DBMS
ER Model and other topics in DBMSHarinarayananR2
 

Similar to Database Management System (20)

chapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdfchapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdf
 
Dbms
DbmsDbms
Dbms
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Model
 
Basic concepts of Data and Databases
Basic concepts of Data and Databases Basic concepts of Data and Databases
Basic concepts of Data and Databases
 
Use analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptxUse analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptx
 
Dbms ii mca-ch3-er-model-2013
Dbms ii mca-ch3-er-model-2013Dbms ii mca-ch3-er-model-2013
Dbms ii mca-ch3-er-model-2013
 
Sq lite module3
Sq lite module3Sq lite module3
Sq lite module3
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
Chapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptxChapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptx
 
27 fcs157al3
27 fcs157al327 fcs157al3
27 fcs157al3
 
ER Model and other topics in DBMS
ER Model and other topics in DBMSER Model and other topics in DBMS
ER Model and other topics in DBMS
 
ER MODEL
ER MODELER MODEL
ER MODEL
 
ER model
ER modelER model
ER model
 
Unit 2 DBMS
Unit 2 DBMSUnit 2 DBMS
Unit 2 DBMS
 
Unit 3 final.pptx
Unit 3 final.pptxUnit 3 final.pptx
Unit 3 final.pptx
 
E R Model details.ppt
E R Model details.pptE R Model details.ppt
E R Model details.ppt
 
Data & Databases
Data & Databases Data & Databases
Data & Databases
 
Db lec 02_new
Db lec 02_newDb lec 02_new
Db lec 02_new
 
database.pptx
database.pptxdatabase.pptx
database.pptx
 
DataBase ch2
DataBase ch2DataBase ch2
DataBase ch2
 

More from FellowBuddy.com

Business Studies Class xii
Business Studies Class xiiBusiness Studies Class xii
Business Studies Class xiiFellowBuddy.com
 
Risk and Risk Aversion FM
Risk and Risk Aversion FMRisk and Risk Aversion FM
Risk and Risk Aversion FMFellowBuddy.com
 
Refrigeration Engineering Lecture Notes
Refrigeration Engineering Lecture NotesRefrigeration Engineering Lecture Notes
Refrigeration Engineering Lecture NotesFellowBuddy.com
 
Production and Operation Management Lecture Notes
Production and Operation Management Lecture NotesProduction and Operation Management Lecture Notes
Production and Operation Management Lecture NotesFellowBuddy.com
 
Leadership Theories {HR}
Leadership Theories {HR}Leadership Theories {HR}
Leadership Theories {HR}FellowBuddy.com
 
Interpersonal Communication Skills {HR}
Interpersonal Communication Skills {HR}Interpersonal Communication Skills {HR}
Interpersonal Communication Skills {HR}FellowBuddy.com
 
Industrial Dispute Act, 1947 {HR}
Industrial Dispute Act, 1947 {HR}Industrial Dispute Act, 1947 {HR}
Industrial Dispute Act, 1947 {HR}FellowBuddy.com
 
Factories act, 1948 {HR}
Factories act, 1948 {HR}Factories act, 1948 {HR}
Factories act, 1948 {HR}FellowBuddy.com
 
Ratio and Proportion, Indices and Logarithm Part 4
Ratio and Proportion, Indices and Logarithm Part 4Ratio and Proportion, Indices and Logarithm Part 4
Ratio and Proportion, Indices and Logarithm Part 4FellowBuddy.com
 
Ratio and Proportion, Indices and Logarithm Part 2
Ratio and Proportion, Indices and Logarithm Part 2Ratio and Proportion, Indices and Logarithm Part 2
Ratio and Proportion, Indices and Logarithm Part 2FellowBuddy.com
 
Ratio and Proportion, Indices and Logarithm Part 1
Ratio and Proportion, Indices and Logarithm Part 1Ratio and Proportion, Indices and Logarithm Part 1
Ratio and Proportion, Indices and Logarithm Part 1FellowBuddy.com
 
Limits and Continuity - Intuitive Approach part 3
Limits and Continuity - Intuitive Approach part 3Limits and Continuity - Intuitive Approach part 3
Limits and Continuity - Intuitive Approach part 3FellowBuddy.com
 
Limits and Continuity - Intuitive Approach part 2
Limits and Continuity - Intuitive Approach part 2Limits and Continuity - Intuitive Approach part 2
Limits and Continuity - Intuitive Approach part 2FellowBuddy.com
 
Limits and Continuity - Intuitive Approach part 1
Limits and Continuity - Intuitive Approach part 1Limits and Continuity - Intuitive Approach part 1
Limits and Continuity - Intuitive Approach part 1FellowBuddy.com
 

More from FellowBuddy.com (20)

Operating System
Operating System Operating System
Operating System
 
Social science class_x
Social science class_xSocial science class_x
Social science class_x
 
Maths class x
Maths class xMaths class x
Maths class x
 
Business Studies Class xii
Business Studies Class xiiBusiness Studies Class xii
Business Studies Class xii
 
Risk and Risk Aversion FM
Risk and Risk Aversion FMRisk and Risk Aversion FM
Risk and Risk Aversion FM
 
Refrigeration Engineering Lecture Notes
Refrigeration Engineering Lecture NotesRefrigeration Engineering Lecture Notes
Refrigeration Engineering Lecture Notes
 
Production and Operation Management Lecture Notes
Production and Operation Management Lecture NotesProduction and Operation Management Lecture Notes
Production and Operation Management Lecture Notes
 
Strategic HRM {HR}
Strategic HRM {HR}Strategic HRM {HR}
Strategic HRM {HR}
 
Leadership Theories {HR}
Leadership Theories {HR}Leadership Theories {HR}
Leadership Theories {HR}
 
Interpersonal Communication Skills {HR}
Interpersonal Communication Skills {HR}Interpersonal Communication Skills {HR}
Interpersonal Communication Skills {HR}
 
Industrial Dispute Act, 1947 {HR}
Industrial Dispute Act, 1947 {HR}Industrial Dispute Act, 1947 {HR}
Industrial Dispute Act, 1947 {HR}
 
Factories act, 1948 {HR}
Factories act, 1948 {HR}Factories act, 1948 {HR}
Factories act, 1948 {HR}
 
Ratio and Proportion, Indices and Logarithm Part 4
Ratio and Proportion, Indices and Logarithm Part 4Ratio and Proportion, Indices and Logarithm Part 4
Ratio and Proportion, Indices and Logarithm Part 4
 
Ratio and Proportion, Indices and Logarithm Part 2
Ratio and Proportion, Indices and Logarithm Part 2Ratio and Proportion, Indices and Logarithm Part 2
Ratio and Proportion, Indices and Logarithm Part 2
 
Ratio and Proportion, Indices and Logarithm Part 1
Ratio and Proportion, Indices and Logarithm Part 1Ratio and Proportion, Indices and Logarithm Part 1
Ratio and Proportion, Indices and Logarithm Part 1
 
Limits and Continuity - Intuitive Approach part 3
Limits and Continuity - Intuitive Approach part 3Limits and Continuity - Intuitive Approach part 3
Limits and Continuity - Intuitive Approach part 3
 
Limits and Continuity - Intuitive Approach part 2
Limits and Continuity - Intuitive Approach part 2Limits and Continuity - Intuitive Approach part 2
Limits and Continuity - Intuitive Approach part 2
 
Limits and Continuity - Intuitive Approach part 1
Limits and Continuity - Intuitive Approach part 1Limits and Continuity - Intuitive Approach part 1
Limits and Continuity - Intuitive Approach part 1
 
Sampling Theory Part 3
Sampling Theory Part 3Sampling Theory Part 3
Sampling Theory Part 3
 
Sampling Theory Part 2
Sampling Theory Part 2Sampling Theory Part 2
Sampling Theory Part 2
 

Recently uploaded

HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use CasesTechSoup
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesSHIVANANDaRV
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonhttgc7rh9c
 

Recently uploaded (20)

HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 

Database Management System

  • 1. 1.1 Introduction1.1 Introduction Traditional database applications New applications: multimedia databases, geographic information system, data warehouses, … Database: A collection of related data. Data: Known facts that can be recorded and have an implicit meaning. (e.g., names, telephone numbers, addresses, …) (indexed address book, diskette, …) 1-21-2 1-1-11
  • 2. 1-2 1-2 Database Management System(DBMS): A software package to facilitate the creation and maintenance of a computerized database. ˙Defining ˙Constructing ˙Manipulating Database System: The DBMS software together with the data itself. Mini-world (Universe of Discourse): Some part of the real world about which data is stored in a database. For example, student grades and transcripts at a university. • Library card catalog: generated & maintained manually • Computerized database
  • 3. 1-3 1-5a Define UNIVERSITY databaseDefine UNIVERSITY database Structure of the record STUDENT ( Name , Number, Class, Major) COURSE ( Name , Number, Credit, Dept.) Data type of data element Name: a string of characters Number: integer Grade: {A,B,C,D,F,I} ….. Constraints The sections that students take must be taught by some instructors.
  • 4. 1-4 1-5b Construct UNIVERSITY databaseConstruct UNIVERSITY database Store data on storage medium ˙store data for each student, course, section, grade repot, prerequisite ˙records in various files may be related to one another Manipulate UNIVERSITY databaseManipulate UNIVERSITY database Query: Retrieve the transcript ( a list of all courses and grades) of Smith. Update: Create a new section for the database course for this semester.
  • 5. 1-5 1-3 Figure 1.1 A simplified database system environment
  • 6. 1-6 1-4 1.2 An Example1.2 An Example Mini-world for the example: Part of a UNIVERSITY environment. Some mini-world entities: - STUDENTs - COURSEs - SECTIONs (of COURSEs) - (academic) DEPARTMENTs - INSTRUCTORs Some mini-world relationships: - SECTIONs are of specific COURSEs - STUDENTs take SECTIONs - COURSEs have prerequisite COURSEs - INSTRUCTORs teach SECTIONs - COURSEs are offered by DEPARTMENTs - STUDENTs major in DEPARTMENTs
  • 7. 7 Entity-Relationship Model  A logical representation of the data for an organization or for a business area  3 constructs:  Entity - person, place, object, event, concept (often corresponds to a row in a table)  Attribute - property or characteristic of an entity (often corresponds to a field in a table)  Relationship – link between entities (corresponds to primary key-foreign key equivalencies in related tables)  Type vs. instance • Entity type: Instructor • Entity instance: Leon Chen  Entity-Relationship Diagram  A graphical representation of entity-relationship model  Also called E-R diagram or just ERD STUDENT Name Registers
  • 8. 8 Sample E-R Diagram (Figure 3-1) Supplier_ID Supplier_Name Supplier_Address Attribute
  • 9. 9 Relationship degrees specify number of entity types involved Entity symbols A special entity that is also a relationship Relationship symbols Relationship cardinalities specify how many of each Attribute symbols
  • 10. 10 Entity  Person: EMPLOYEE, STUDENT  Place: WAREHOUSE, COUNTRY  Object: BUILDING, MACHINE  Event: SALE, REGISTRATION  Concept: ACCOUNT, COURSE EMPLOYEE DEPENDENT Strong entity Weak entity Associative entity CERTIFICATE
  • 11. 11 What Should an Entity Be?  SHOULD BE:  An object that will have many instances in the database  An object that will be composed of multiple attributes  An object that we are trying to model  SHOULD NOT BE:  A user of the database system  An output of the database system (e.g. a report)
  • 12. 12 Inappropriate entities System userSystem user System outputSystem output Appropriate entities Figure 3-4
  • 13. 13 Attribute  Attribute - property or characteristic of an entity type  Classifications of attributes:  Required vs. Optional Attributes  Simple vs. Composite Attribute  Single-Valued vs. Multivalued Attribute  Stored vs. Derived Attributes  Identifier Attributes - keys
  • 14. 14 Required vs. Optional Attributes  Example: entity – ONLINE_ACCOUNT  Required attributes (Not NULL) • Account_ID • Password • Owner_Name  Optional attributes • Phone_Number • Password_Hint
  • 15. 15 Figure 3-7 – A composite attribute An attribute broken into component parts
  • 16. 16 Figure 3-8 – Entity with a multivalued attribute (Skill) and derived attribute (Years_Employed) Derived from date employed and current date Multivalued: an employee can have more than one skill
  • 17. 17 Figure 3-19 – An attribute that is both multivalued and composite This is an example of time-stamping. More examples?
  • 18. 18 Identifiers (Keys)  Identifier (Key) - An attribute (or combination of attributes) that uniquely identifies individual instances of an entity type  Candidate Key – an attribute that could be a key. Examples (for STUDENT, PERSON)?  Simple Key versus Composite Key
  • 19. 19 Figure 3-9a Simple key attribute The key is underlined
  • 20. 20 Figure 3-9b Composite key attribute Flight_Number Date
  • 21. 21 Guidelines for Identifiers  Will not change in value  Will not be null  Substitute new, simple keys for long, composite keys  ?  Game_Number
  • 22. 22 Relationship  Relationship Type vs. Relationship Instance  Degree of a relationship  Cardinality of a relationship  Associative Entity – combination of relationship and entity
  • 23. 23 Figure 3-11a The relationship type is modeled as the diamond and lines between entity types attribute of the relationship
  • 24. 24 Relationship Instance is between specific entity instances
  • 25. 25 One entity related to another of the same entity type Entities of two different types related to each other Entities of three different types related to each other Degree of a relationship is the number of entity types that participate in it
  • 26. 26 Cardinality of a Relationship  One-to-One  Each entity in the relationship will have exactly one related entity  One-to-Many  An entity on one side of the relationship can have many related entities, but an entity on the other side will have a maximum of one related entity  Many-to-Many  Entities on both sides of the relationship can have many related entities on the other side
  • 27. 27
  • 28. 28
  • 29. 29 Note: a relationship can have attributes of its own
  • 30. 30 Cardinality Constraints  Cardinality Constraints - the number of instances of one entity that can or must be associated with each instance of another entity  Minimum Cardinality. Examples?  If zero, then optional  If one or more, then mandatory  Maximum Cardinality. Examples?  The maximum number
  • 32. 32 Figure 3-16a Basic relationship Mandatory minimum cardinalities – Figure 3-17a
  • 33. 33 Figure 3-17c Optional cardinalities with unary degree, one-to-one relationship
  • 35. 35 Entities can be related to one another in more than one way
  • 36. 36 Attributes can be transformed to relationships Attributes or Relationship?
  • 37. 37 Attributes should be transformed to relationships Attributes or Relationship?
  • 38. 38 Associative Entities  It’s an entity – it has attributes  AND it’s a relationship – it links entities together  When should a relationship with attributes be an associative entity?  All relationships for the associative entity should be many  The associative entity could have meaning independent of the other entities  The associative entity should have at least one or more attributes other than the identifier  The associative entity may participate in other relationships other than the entities of the associated relationship  Ternary relationships should be converted to associative entities
  • 39. 39Figure 3-11b – An associative entity (CERTIFICATE)
  • 40. 40 Bill of materials structure
  • 41. 41 Figure 3-18 – Ternary relationship as an associative entity
  • 42. 42 Strong vs. Weak Entities  Strong entities  exist independently of other types of entities  has its own unique identifier  represented with single-line rectangle  Weak entity  dependent on a strong entity…cannot exist on its own  does not have a unique identifier  represented with double-line rectangle  Identifying relationship  links strong entities to weak entities  represented with double line diamond
  • 43. 43 Strong entity Weak entityIdentifying relationship
  • 44. 44 Figure 3-22a E-R diagram for Pine Valley Furniture
  • 45. 45 Microsoft Visio Notation for Pine Valley Furniture Different modeling software tools may have different notation for the same constructs
  • 46. 46 Relationship degrees specify number of entity types involved Entity symbols A special entity that is also a relationship Relationship symbols Relationship cardinalities specify how many of each Attribute symbols
  • 47. 47 Sample E-R Diagram (Figure 3-1) Supplier_ID Supplier_Name Supplier_Address Attribute
  • 48. 48 E-R Diagram for a Banking Enterprise
  • 49. Library Case Study  When a library first receives a book from a publisher it is sent, together with the accompanying delivery note, to the library desk. Here the delivery note is checked against a file of books ordered.  If no order can be found to match the note, a letter of enquiry is sent to the publishers. If a matching order is found, a catalogue note is prepared from the details on the validated delivery note.  The catalogue note, together with the book, is sent to the registration department. The validated delivery note is sent to the accounts department where it is stored.  On receipt of an invoice from the publisher, the accounts department checks its store of delivery notes. If the corresponding delivery note is found then an instruction to pay the publishers is made, and subsequently a cheque is sent. If no corresponding delivery note is found, the invoice is stored in a pending file. 
  • 50. A Case Study Conference centre booking system A conference centre takes bookings from clients who wish to hold courses or conferences at the centre. When clients make bookings they specify how many people are included in the booking, and of these, how many will be resident during the booking, and how many will require catered or non-catered accommodation at the centre. The centre contains a number of facilities which may be required by clients making bookings as follows: A. There are 400 bedrooms for clients who will be resident during the Course or conference. B. A maximum of 250 catered people can be handled at any one time. C. Six main lecture theatres providing seating for 200 people. D. Twenty seminar rooms each able to accommodate 25 people. E. Video conference facilities. The video conference facilities consist of four separate video conference networks. Each video conference network has a large screen based in one of the main lecture theatres, along with 3 satellite screens each of which is based in one of the seminar rooms. Draw an entity relationship diagram for the case, stating any assumptions you deem necessary.
  • 51. Shipping company example  The London and Ireland Shipping Company PLC (LISC) was founded in 1852 and owns a fleet of cargo ships. The company had historically run passenger liners, but recent policy decisions involved the sale of all passenger- carrying vessels. The company currently has 14 vessels, including one oil tanker and one tugboat operating out of Liverpool. Most of the vessels are registered in Liberia for tax reasons.  Each ship has one or more holds divided into spaces. The holds are defined by steel bulkheads and the spaces are defined by shelf racks or other physical dividers. Sister ships, built by the same shipbuilders and to the same designs have similar names, such as Pride of Ireland, Queen of Ireland, Song of Ireland and Warrior of Ireland. Sister ships also have identical cargo storage facilities.  LISC issues contracts to agents for one or more manifests (lists of cargo items to be shipped). LISC's charges for cargo carried are based on the number of spaces the cargo requires for storage. The types of cargo typically carried by LISC include grain, coal and ores (carried only in ships equipped with bulk cargo holds). They also transport sacked grain, heavy cases, containers (which may be carried on deck), pallets and so on.  Cargo items may take up less than one space in a hold, or one or more spaces, depending on the size of the item. A space may therefore contain several small cargo items.  The ships owned by LISC are kept as busy and as full as possible, in order to maximise the profits that each vessel makes and minimise running & operating costs. LISC's ships ply most of the seas of the world, but tend to operate mainly in the Mediterranean, the North and Mid Atlantic and the Indian Ocean. Different ships require different crew complements.  LISC intends to create a computer based information system that will be able to perform the following tasks:  • record the voyages of each ship with the start and end ports.  • record the cargo held by a ship on each voyage  • keep records of their employees and the ships they are assigned to  • producing invoices for agents and customers  • keep a record of customers' payments on invoices  • analyse the efficiency of use of cargo space and of percentage wasted cargo space for ships voyages
  • 52. 1-52 1-6 1.3 Characteristics of the Database Approach1.3 Characteristics of the Database Approach • File Processing Each user defines and implements the files needed for a specific application Redundancy in defining & storing data • Database Approach A single repository of data -Self-describing nature of a database system: A DBMS catalog stores the description of the database. The description is called meta-data . This allows the DBMS software to work with different databases. catalog: structure of each file, type & storage format of each data item, constraints on data -Insulation between programs and data: Called program-data independence. Allows changing data storage structures without having to change the DBMS access programs.(see 1-7) program– Interface + method operation independence (OODB)
  • 53. 1-53 1-11 1.6 Advantages of Using a DBMs1.6 Advantages of Using a DBMs 1.6.1 Controlling Redundancy in data storage and in development and maintenance efforts. duplication efforts waste space inconsistent‧ ‧ ‧ ( see 1-12 controlled redundancy) 1.6.2 Restricting Unauthorized Access (security and authorization) 1.6.3 Providing Persistent Storage for Program Objects and Data Structures. 1.6.4 Permitting Inferencing and Actions Using Rules 1.6.5 Providing Multiple User Interfaces 1.6.6 Representing Complex Relationships Among data. 1.6.7 Enforcing Integrity Constraints 1.6.8 Providing Backup and Recovery
  • 54. 1-54 1-11 -Potential for Enforcing Standards. -Reduced Application Development Time. -Flexibility. -Availability of Up-to-date Information. -Economies of Scale. 1.7 Implications of the1.7 Implications of the DatabaseDatabase ApproachApproach
  • 55. 1-55 1-13 1.8 When not to use a DBMS1.8 When not to use a DBMS Main costs of using a DBMS: - High initial investment in hardware, software,training and possible need for additional hardware. - Overhead for providing generality, security, recovery, integrity, and concurrency control. - Generality that a DBMS provides for defining and processing data. When a DBMS may be unnecessary: - If the database and applications are simple, well defined, and not expected to change. - If there are stringent real-time requirements that may not be met because of DBMS overhead. - If access to data by multiple users is not required.
  • 56. Summary In today’s session we have learned to: Identify the entities Determine the attributes for each entity Select the primary key for each entity Establish the relationships between the entities Draw an entity model