Professional Documents
Culture Documents
Lecture Overview
• Typical Components of a Database
Environment
• Database Architecture
• 3 – tier Architecture
• External View of the database
• Conceptual view of the database
• Internal view of the database
Component of Database Environment
STUDENT
Social_Security_No
Name
Major
Data Models
• Data Model: Graphical systems used to
capture the nature and relationship among
data.
OR
• Data model is a set or collection of construct
used for creating a database and producing
designs for the databases.
Design Phase
Types of Data models
• Semantic Data Model
o ER- Data Model
o Object oriented data Model
• Record Based Data Model
o Hierarchical Data Model
o Network Data model
o Relational Data model
Types of Database Design
Conceptual database design: Implemented
using a semantic data model
37
Data Definitions
• Explanation of a term or fact
– Term–word or phrase with specific meaning
– Fact–association between two or more terms
• Guidelines for good data definition
– A concise description of essential data meaning
– Gathered in conjunction with systems
requirements
– Accompanied by diagrams
– Achieved by consensus, and iteratively refined
Entity relationship data model
Entity Attribute
symbols symbols
A special entity
that is also a Relationship
relationship symbols
Relationship
degrees specify
number of
entity types Relationship
involved cardinalities
specify how
many of each
entity type is
allowed
Elements of an E-R diagram
WEAK ASSOCIATIVE
ENTITY
ENTITY ENTITY
MULTIVALUED DERIVED
ATTRIBUTE ATTRIBUTE
ATTRIBUTE
RELATIONSHIP INDENTIFYING
RELATIONSHIP
Entity
A person, place, object, event, or concept in the user
environment about which the organization wishes to
maintain data.
Person: Employee, student, Patient
Place: Store, Department, Inventory
Object: Machine, Building, Automobile
Event: Sale, Registration
Concept: Account, Course
Entities
The term entity is used in three different
meanings or for three different terms and that
are:
• Entity type
• Entity instance
• Entity set
Cont…
• Entity type: a collection of entities that share
common properties or characteristics.
• Entity Instance: A single occurrence of any
entity type.
• Entity Sets: A group of entity instances of a
particular entity type is called an entity set.
Example
An Entity…
• 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)
48
Example of inappropriate entities
System System
user Inappropriate output
entities
Appropriate
entities
49
Strong vs. Weak Entities, and
Identifying Relationships
• Strong entity
• exists independently of other types of entities
• has its own unique identifier
• identifier underlined with single line
• Weak entity
• dependent on a strong entity (identifying owner)…cannot
exist on its own
• does not have a unique identifier (only a partial identifier)
• entity box and partial identifier have double lines
• Identifying relationship
• links strong entities to weak entities
50
Example of a weak identity and its identifying relationship
51
Naming Entity Types
• Singular noun recommended, but still plurals can also be used
Required – must have a value for every Optional – may not have a value for every
entity (or relationship) instance with which it entity (or relationship) instance with which it
is associated is associated
Simple or Composite Attributes:
• An attribute that is a single whole is a simple attribute. The
value of a simple attribute is considered as a whole, not as
comprising of other attributes or components. E.g. Name,
FatherName, DateOfBorth of an entity type STUDENT
• An attribute consists of collection of other simple or
composite attributes then it is called a composite attributes.
For example, Address attribute may comprise of houseNo,
streetNo, areaCode, city etc.
Simple vs. Composite Attributes
The address is
broken into
component parts
A composite attribute
60
Single valued or multi-valued
Attributes
• Some attribute have single value at a time, whereas some
others may have multiple values. For example, hobby
attribute of STUDENT or skills attribute of EMPLOYEE, since
a student may have multiple hobbies, likewise an employee
may have multiple skills so they are multi-valued attributes.
Multivalued – may take on more than one Derived – values can be calculated from
value for a given entity (or relationship) related attribute values (not physically
instance stored in the database)
Entity with multivalued attribute (Skill) and derived attribute (Years Employed)
Multivalued Derived
an employee can Calculated
have more than one from date
skill employed
and current
date
Identifiers (Keys)
64
Criteria for Identifiers
• Choose Identifiers that
65
Simple and composite identifier attributes
The identifier
is boldfaced
and underlined
Symbols for Attributes
Example entity type with attributes of different types