entity relationship data model l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Entity-Relationship Data Model PowerPoint Presentation
Download Presentation
Entity-Relationship Data Model

Loading in 2 Seconds...

play fullscreen
1 / 17

Entity-Relationship Data Model - PowerPoint PPT Presentation


  • 218 Views
  • Uploaded on

Entity-Relationship Data Model. CS 157A Professor Sin-Min Lee Student: Yen-Chu Pan. Elements of E-R Model. In the E/R model, the structure of data is represented graphically, as an “entity-relationship diagram,” using three Principal element types: Entity Sets.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Entity-Relationship Data Model' - betty_james


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
entity relationship data model

Entity-Relationship Data Model

CS 157A

Professor Sin-Min Lee

Student: Yen-Chu Pan

elements of e r model
Elements of E-R Model
  • In the E/R model, the structure of data is represented graphically, as an “entity-relationship diagram,” using three Principal element types:
    • Entity Sets.
      • An entity is an abstract object of some sort, and a collection of similar entities forms an entity set.
    • Attributes
      • The properties of the entities in the set.
    • Relationship
      • The connections among two or more entity Sets
example of elements of e r model
Example of Elements of E-R Model
  • Entity Sets
    • Departments
    • Professors
    • Students
    • Administrators
  • Attributes
    • Name of Departments, Phone No., Address...
    • Name, SSN, Address of Professors...
  • Relationship
    • Students and Professors are under a certain department
    • Admin manage the campus/ departments
classification of constraints
Classification of Constraints
  • Keys
  • Single-value constraints
  • Multi-valuedconstraints
  • Mapping Cardinalities and Participation Constraints
key in the e r model
Key in the E/R Model
  • Superkey is a set of one or more attributes that, taken collectively, for us to identify uniquely an item in the entity set. For example, customer-id is a superkey.
  • Candidate key is a minimal superkey. For example, customer-name and customer-street is sufficient to distinguish among members of the customer entity set. Then {customer-name, customer-street } is a candidate key.
  • Primary key denotes a candidate key that is chosen by the database designer as the principal means of identifying items within an entity set. the primary key should be chosen such that its attributes are never, or very rarely, changed. For example, Social-security numbers are guaranteed to never changed.
single multi valued attributes
Single/Multi-valued attributes
  • Single-valued attributes are attributes that only have a single value for a particular entity.
  • Multi-valued attributes refers to items that are not singled-value and Null valued. For example, consider an employee entity set with the attribute phone-number. An employee may have zero, one, or several phone numbers; different employee may have different numbers of phones.
mapping cardinalities or cardinality ratios
Mapping Cardinalities or Cardinality ratios
  • Express the number of items to which another item can be associated via a relationship set
  • Are most useful in describing binary relationship sets. For a binary relationship set R between entity sets A and B, the mapping cardinality must be one of the following:
    • One to One
    • One to Many
    • Many to One
    • Many to Many
participation constraints
Participation Constraints
  • The participation of an entity set E in a relationship set R is said to be total, if every item in E participates in at least one relationship in R. If only some items in E participate in relationship R, the participation of entity set E in relationship R is said to be partial.
weak entity sets
Weak Entity Sets
  • There is an occasional condition in which an entity set’s key is composed of attributes some or all of which belong to another entity set. Such an entity set is called a weak entity set.
discriminator
Discriminator
  • The discriminator of a weak entity set is a set of attributes that allows this distinction to be made. For example, the discriminator of a weak entity set payment is the attribute payment-number, since, for each loan a payment number uniquely identifies one single payment for that loan. The discriminator of a weak entity set is also called the partial key of the entity set.
requirements for weak entity sets
Requirements for Weak Entity Sets
  • We cannot obtain key attributes for a weak entity set indiscriminately. Rather, if E is a weak entity set then its key consists of:
    • Zero or more of its own attributes, and
    • Key attributes from entity sets that are reached by certain many-one relationship from E to other entity sets. These many-one relationship are called supporting relationships for E.
discriminator cont
Discriminator (cont.)
  • Note: although each payment entity is distinct, payments for different loans may share the same payment-number. Thus, payment entity set does not have a primary key; it is a weak entity set.
  • The primary key of a weak entity set is formed by the primary key of the identifying entity set, plus the weak entity set’s discriminator.
identifying a weak entity type
Identifying a Weak Entity Type
  • A Weak entity type doesn’t have a primary key.
  • If X is a weak entity type and Y is the entity type on which X is dependent.
  • We form a primary key for X by combining the primary key of Y which one or more attributes, called discriminator or partial key, from X.
  • In an E/R Diagram, a partial key is usually dash-underlined.
  • e.g., primary key for DEPENDENT: {Employee No., DName}.
slide16

*

* Doted-line = double-line

references
References
  • Peter Chen’s website: http://bit.csc.lsu.edu/~chen/chen.html
  • Database Systems: A First Course, J.D. Ullman & J. Widom
  • http://www-db.stanford.edu/~ullman/fcdb.html
  • http://www.cs.sjsu.edu/faculty/lee/cs157/25Sp157AL4.ppt
  • http://www.cs.sjsu.edu/faculty/lee/cs157/25Sp157AL5Enhanced%20ER-diagram.ppt