DATABASE MANAGEMENT SYSTEMS - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

DATABASE MANAGEMENT SYSTEMS

Description:

Role of Entity Relationship Model. Units in Entity Relationship ... Company car licence number. Stock option (price) Works-for. Manages. Start-date. Dep-emp ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 19
Provided by: agi57
Category:

less

Transcript and Presenter's Notes

Title: DATABASE MANAGEMENT SYSTEMS


1
A szakirány neve
  • DATABASE MANAGEMENT SYSTEMS

Modul 1 1.2 Entity/Relationship Model (1
Lecture)
Az Európai Szociális Alap támogatásával
2
Outline
  • ? Role of Entity Relationship Model
  • ? Units in Entity Relationship Model
  • -entitiy set
  • -attributes
  • - relationship set
  • - specialties for each
  • ? Keys
  • ? Summary notation

3
  • Conceptual level
  • Object based models we are dealing with
  • Entity Relationship model (grafic standard)
  • UML

4
Building a database
5
Entity set
  • Entity set
  • its elements are the entities, sharing same
    properties, called attributes ( like a class)
  • Entity is an object distinguishable from other
    object in the microworld through its attributes
  • Example person, real object, notion, etc.
  • Notation rectangle, example

person
6
Attribute
  • Attributes entities share the same
    propertiesattributes
  • Example a person has name, address
  • Notation oval, joint by a line segment to an
    entity, relationship or attribute
  • Example

7
Attribute
  • Specialties composite attribute
  • May have other (sub)attributes
  • Notation the same oval, joint to the super
    attribute
  • Example

8
Relationship
  • Relationship set, briefly relationship
  • a logical connection, association between two
    or more entity sets
  • Notation diamond,
  • joint to the participating entity sets. An
    arrow is used, if exactly one entitiy is
    associated to the other
  • a child have exactly one mother
  • Example the entity set children and the entity
    set females may be assiciated through a
    mother-of relationship

9
Relationship
  • Degree of a relationship set number of
    participating entitiy sets
  • Binary rerlationship sets only two entity sets
    are associated by it
  • Types
  • - one to one (wife-husband)
  • - one to many (mother-children)
  • - many to many (account-bank_customer)

10
KEYS
  • Superkey set of attributes uniquely identify
    the entity (could be many)
  • (Candidate) key minimal set of attributes
    uniquely identify the entity
  • (could be many)
  • Primary key arbitrarily chosen
  • (candidate) key (only one)
  • Notation all primary key attributes are
    underlined

11
Specialties
  • Weak entity set has not enough attributes
    for identifying the entities
  • Notation rectangle bordered by doubled line
  • A weak entity set must joint to another
    (strong) entity set through a 1 to many
    relationship, whose one side is the strong
    entity. This relationship is called also weak.
  • Notation for weak entity/relationship sets
  • Block/Diamond bordered by doubled lines

12
Key for weak entitiy
  • Usually at least weak entities have a so called
    discriminator-unique in that context only
  • The discriminator and the primary keys of all
    strong entities of participating a one to many
    weak relationship will form the key.

13
Example
  • Keys for contract

Salary
Contract
Plays_in
Works_for
of
Color
Actors
Studio
Film
Address
lenght
Name
Year
Address
Name
Title
14
Specialties specialization, generalization ISA
  • Source Ullman Widom Databas system, First
    course

Sound
gun
Cartoon
Crime
Crime cartoon
15
ISA
  • Bottom up generalization
  • Top down spacialization
  • Sub entitiy set inherits all the attributes of
    the superset
  • Important to know wther the specialization is a
    partition-it influences the implementation

16
Example Analize the figure below

Relationship
Birth-date
Name
Dependent
City
Street
Number
Name
Dep-emp
Location
Address
Works-for
Salary
employee
department
Number
SSN
Manages
Name
ISA
Start-date
Bonus
manager
CELL-phone
Company car licence number
Stock option (price)
17
Design principles
  • Correct reflection of the microworld
  • Simpliest solution is the best
  • Avoiding redundancy
  • Correct decision about the type of the stored
    object
  • - Is it an entity?
  • - Is it an attribute?
  • - Is it a relationship?
  • The answer may be different in different
    enterprises

18
Summary Entity Relationship Model
  • Notations

Entity set
Weak entity set
Attribute, with primary key
___
Multivalued attribute
Composite attribute
ISA specification, generalization
Relationship set
Weak relationship set
N1 relationship set, pointing to 1 side
Write a Comment
User Comments (0)
About PowerShow.com