DOC PREVIEW
SJSU CS 157A - Enhanced ER-diagram

This preview shows page 1-2-3-4-5-33-34-35-36-67-68-69-70-71 out of 71 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 71 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Enhanced ER-diagramSlide 2Slide 3Slide 4RELATIONSHIPS (Cont…)Slide 6Slide 7Slide 8BINARY RELATIONSHIPKEYSlide 11EXAMPLESlide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23Slide 24Slide 25Slide 26Slide 27Slide 28Slide 29Slide 30Slide 31Slide 32Slide 33Slide 34Slide 35Slide 36Slide 37Enhanced-ER (EER) Model ConceptsSubclasses and Superclasses (1)Slide 40Subclasses and Superclasses (2)Attribute Inheritance in Superclass / Subclass RelationshipsSpecializationExample of a SpecializationGeneralizationGeneralization and SpecializationSlide 47Constraints on Specialization and Generalization (1)Constraints on Specialization and Generalization (2)Constraints on Specialization and Generalization (3)Example of disjoint partial SpecializationSpecialization / Generalization Hierarchies, Lattices and Shared SubclassesSlide 53Specialization / Generalization Lattice Example (UNIVERSITY)Categories (UNION TYPES)Slide 56Example of categories (UNION TYPES)Slide 58GENERALIZATION AND SPECIALIZATIONSlide 60Slide 61Slide 62Slide 63Slide 64Slide 65GeneralisationUML Example for Displaying Specialization / GeneralizationAlternative Diagrammatic NotationsSlide 69Slide 70Slide 71Enhanced ER-diagramProf. Sin-Min LeeDepartment of Computer ScienceDatabase Modeling and Implementation ProcessIdeas ER Design Relational SchemaRelational DBMSImplementation•Example: A library database contains a listing of authors that have written books on various subjects (one author per book). It also contains information about libraries that carry books on various subjects.RELATIONSHIPS (Cont…)•Example: A library database contains a listing of authors that have written books on various subjects (one author per book). It also contains information about libraries that carry books on various subjects.Entity sets: authors, subjects, books, librariesRELATIONSHIPS (Cont…)•Example: A library database contains a listing of authors that have written books on various subjects (one author per book). It also contains information about libraries that carry books on various subjects.Entity sets: authors, subjects, books, librariesRelationship sets: wrote, carry, indexedRELATIONSHIPS (Cont…)carrybooksindexwrotesubjectauthorsSS#nametitlelibrariesaddressisbnSubjectmatterRELATIONSHIPS (Cont…)carrybooksindexwrotesubjectauthorsSS#nametitlelibrariesquantityaddressisbnSubjectmatterBINARY RELATIONSHIPA binary relationship between entity set A and B might be:•1:1 Women marrying Men (function)•N:1 Children having mothers (function)•1:N Mothers having children (inverse function)•M:N Students enrolled in a classwomenmarrymenchildrenhavingmothersmothershavingchildrenstudentsenrolledclasses1nn1ABABABABKEY•Entities and relationships are distinguishable using various keys•A key is a combination of one or more attributes, e.g., social-security number, combination of name and social-security number.•A superkey is a key defined either for an entity set or relationship set that uniquely identifies an entity, e.g., social-security number, phone number, combination of name and social-security number.•A candidate key is a minimal superkey that uniquely identifies either an entity or a relationship, e.g., social-security number, phone number.•A primary key is a candidate key that is chosen by the database designer to identify the entities of an entity set.•A foreign key is a set of one or more attributes of a strong entity set that are employed to construct the discriminator of a weak entity set. The primary key of a weak entity set is formed by the primary key of the strong entity set on which it is existence-dependent.•Relationship sets also have primary keys. Assume R is a relationship set involving entity sets E1, E2, ..., En. Let primary-key(Ei) denote the primary key for entity set Ei. Assume primary-key(Ei) is unique for 1 ≤ i ≤ n. If R has no attributes then its superkey is:primary-key(E1) ∪ primary-key(E2) ... ∪ ∪ primary-key(En)•This is a primary key if the mapping constraint is many-to-many.•If the mapping constraint is many to one from E1 to E2 then the primary key of R is primary key of E1.bookswroteauthorsSS#nametitleeditionE1RE2EXAMPLE•Employees of a large company, e.g., IBM, where an employee reports to a manager. The manager is also an employee who reports to another manager. This chain of command continues to the very top where the CEO is the only employee who is not reporting to a manager. Draw the ER diagram for this example.WorksforEmpSS#nameaddressWorksforEmpSS#nameaddressPrimary keys:Emp: SS#Works-for: (empSS#, mgrSS#)Primary keys:Emp: SS#Works-for: (empSS#)•A relationship may involve n entities, N-ary relationship•It is always possible to replace a non-binary relationship set by a number of distinct binary relationship setsFootball TeamsfansPeopleDateonAggregation Consider the ternary relationship works-on, which we saw earlier Suppose we want to record managers for tasks performed by an employee at a branchE-R Diagram With Aggregation•Example: A library database contains a listing of authors that have written books on various subjects (one author per book). It also contains information about libraries that carry books on various subjects.Entity sets: authors, subjects, books, librariesRelationship sets: wrote, carry, indexedE-R diagram:Enhanced Entity-Relationship Model•Since 1980s there has been an increase in emergence of new database applications with more demanding requirements.•Basic concepts of ER modeling are not sufficient to represent requirements of newer, more complex applications.•Response is development of additional ‘semantic’ modeling concepts.Enhanced-ER (EER) Model Concepts•Includes all modeling concepts of basic ER •Additional concepts: subclasses/superclasses, specialization/generalization, categories, attribute inheritance•The resulting model is called the enhanced-ER or Extended ER (E2R or EER) model•It is used to model applications more completely and accurately if needed•It includes some object-oriented concepts, such as inheritanceSubclasses and Superclasses (1)•An entity type may have additional meaningful subgroupings of its entities•Example: EMPLOYEE may be further grouped into SECRETARY, ENGINEER, MANAGER, TECHNICIAN, SALARIED_EMPLOYEE, HOURLY_EMPLOYEE,…–Each of these groupings is a subset of EMPLOYEE entities –Each is called a subclass of EMPLOYEE


View Full Document

SJSU CS 157A - Enhanced ER-diagram

Documents in this Course
SQL

SQL

18 pages

Lecture

Lecture

44 pages

Chapter 1

Chapter 1

56 pages

E-R Model

E-R Model

16 pages

Lecture

Lecture

48 pages

SQL

SQL

15 pages

SQL

SQL

26 pages

Lossless

Lossless

26 pages

SQL

SQL

16 pages

Final 3

Final 3

90 pages

Lecture 3

Lecture 3

22 pages

SQL

SQL

25 pages

Load more
Download Enhanced ER-diagram
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Enhanced ER-diagram and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Enhanced ER-diagram 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?