DOC PREVIEW
SJSU CS 157A - Database Design

This preview shows page 1-2-3-20-21-40-41-42 out of 42 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 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 42 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 42 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 42 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 42 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 42 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 42 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 42 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

PowerPoint PresentationSlide 3Slide 4E-R ModelSlide 6The Entity-Relationship Model (History)Slide 8The Entity-Relationship ApproachMore TerminologySlide 11Slide 12Three Basic Graphical Symbols in an ER DiagramSlide 14Slide 15BASIC CONCEPTSAN ENTITYENTITY SETSATTRIBUTEATTRIBUTE TYPESATTRIBUTE TYPESSlide 22Slide 23Slide 24RELATIONSHIP SETSRECURSIVE RELATIONSHIPBINARY RELATIONSHIP SETSTERNARY RELATIONSHIP SETDEGREE OF A RELATIONSHIP SETCONSTRAINTSSlide 31MAPPING CARDINALITIESMAPPING CARDINALITIESSlide 34Slide 35KEYSKEYRELATIONSHIP SETSSlide 39Slide 40DESIGN ISSUEUSE OF ENTITY SETS VERSUS ATTRIBUTESENTITY-RELATIONSHIP DIAGRAM1–21–31–41–5E-R Model•The E-R model is not intended to be associated with any particular database model. •E-R diagrams are intended to allow humans the ability to capture more of the application’s meaning.1–61–7The Entity-Relationship Model (History)•Developed by Peter Chen in the 1970’s•Several variations have evolved•All are designed towards the concise capture of the application semantics in terms appropriate for subsequent mapping to a specific database model.•It is currently the most widely used.1–81–9The Entity-Relationship Approach•Entity: an object that exists and is distinguishable from other objects. i.e. person, place, thing, event or concept about which information(attributes) is recorded. The basic unit of the E-R model.•The structure of an entity is called its schema.1–10More Terminology•Object: things in the real world that can be observed and classified because they have related properties•Entity: the groupings we use when we categorize the objects. Sometimes called a class.1–111–121–13Three Basic Graphical Symbols in an ER Diagram•Rectangles are used to model conceptual data units or data objects.•Circles are used to model attributes. Attributes are the characteristics, components or properties of entities.•Diamonds are used to model the structural associations that exist between entities.CourseCIDEnroll1–141–151–16 BASIC CONCEPTSThere are 3 basic notions in the E-R Model: Entity Sets Relationship Sets Attributes1–17AN ENTITY An entity is a “thing” or “object” in the real world that is distinguishable from all other objects. It has an unique set of properties that may uniquely identify an entity. For example, a student entity has three attributes: name , student-id, and social-security numbers. John 1222 123-12-2244STUDENT entity1–18 ENTITY SETSAn entity set is a set of entities that share the same properties or attributes. Entity sets do not need to be disjoint. For example, a customer can also be an employee.John 1222 123-12-2244Kathy 2223 223-22-2245Steve 3222 723-12-2244Customer (Entity Set)John ManagerKathy TellerSteve TellerEmployee (Entity Set)1–19ATTRIBUTEAn entity is represented by a set of attributes. Attributes are descriptive properties possessed by each member of an entity set.Example: STUDENTss#student-id addressnameSTUDENT entityAttributes1–20ATTRIBUTE TYPESThere are several different types of attributes. Simple and Composite Single-valued and Multivalued Derived Null1–21ATTRIBUTE TYPES Simple attributes are not divided into subparts. Composite attributes can be divided into subparts. Using composite attributes in a design schema is a good choice if a user will wish to refer to an entire attribute on some occasions.1–22ATTRIBUTE TYPESExample: address (Composite attribute) street city state zipstreet-number street-name apartment-number Composite attribute1–23ATTRIBUTE TYPES Single-valued attributes are attributes that only have a single value for a particular entity. Multi-valued attributes refers to entities 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.1–24ATTRIBUTE TYPES Null attribute is used when an entity does not have a value for an attribute. Derived attributes refer to an attribute that can be derivedfrom other related attributes or entities. For instance, suppose that Age and Date-of-birth are attributes of the CUSTOMER entity set. We can calculate Age from Date-of-birth. In this case, Age is a derived attribute.1–25RELATIONSHIP SETS A relationship is an association among several entities. A relationship set is a set of relationships of the same type. Consider the two entity sets customer and loan. We define the relationship set borrower to denote the association between customers and bank loans that the customers have. 321-12-3123 Jones Main Harrison019-28-3746 Smith North Rye555-55-5555 Jackson Dupont Woodside321-12-3123 Curry North Rye321-12-3123 Adam Spring PittsfieldL-17 1000L-23 2000L-14 1500L-19 500L-16 1300customerloan1–26RECURSIVE RELATIONSHIP Recursive relationship- the same entity set participates in a relationship set more than once, in different roles. The function that an entity plays in a relationship is called that entity’s role. For example, consider an entity set employee that records information about all employees of the bank. We may have a relationship set works-for that is modeled by ordered pairs of employee entities. The first employee of a pair takes the role of worker, whereas the second takes the role of manager. employeeemployee-nametelephone-numberemployee-idworks-formanagerworkerRecursive Relationship1–27 BINARY RELATIONSHIP SETS Binary relationship set - relationship that involves two identity sets. Most of the relationship sets in a database system are binary. Occasionally, however, relationship set involve more than two entity. OWNEROwnsPROPERTY-FOR-RENTBinary relationship called Owns1–28 TERNARY RELATIONSHIP SET Ternary relationship set - relationship that involves three identity sets DEGREEDATEPERSONearnedPERSON earned DEGREE on DATETernary Relationship Set1–29 DEGREE OF A RELATIONSHIP SET Degree of a relationship set is the number of entity sets that participate in a relationship set. For example, a binary relationship set is of degree 2; a ternary relationship set is of degree 3.1–30CONSTRAINTSAn E-R enterprise scheme may define certain constraints to which the contents of a database must conform. The two of most important types of constraints are Mapping Cardinalities and Participation Constraints. Participation Constraints The participation of an entity set E in a


View Full Document

SJSU CS 157A - Database Design

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 Database Design
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 Database Design 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 Database Design 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?