DOC PREVIEW
UW CSE 444 - Lecture Notes

This preview shows page 1-2 out of 6 pages.

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

Unformatted text preview:

Mapping E/R to RelationalBig PictureEntitiesRelationshipsN:M relationshipsAttributes10/7/97 D-1Mapping E/R to RelationalTextbook Ch. 6.8@1997 UW CSE10/7/97 E-2Big Picture•E/R is better for design than relational•Better semantics, closer to user view•Relational is better for implementation–RDBMS's are widely available•Mapping E/R to relational is pretty mechanical–Roughly: entities map to entities; relationships show up as foreign keys or new relations; all attributes end up somewhere10/7/97 E-3Entities•Strong entities (i.e., having a key)–map unchanged•Weak entities–add to the entity the (foreign) key of its ownerAs we'll soon see, additional attributes may get added...10/7/97 E-4Relationships•Entities S and T are 1:1 in the relationship–Add T's key as foreign key to S–Add any relationship attributes to S–If one of the entities is total, use it as S•Entities S and T are N:1 (S is the N side)–Add T's key as foreign key to S–Add any relationship attributes to S10/7/97 E-5N:M relationships•Create a new relation–contains the keys of both S and T as attributes–contains a row for each pair of related S and T entities–contains the relationship attributes•Ternary and higher relationships–proceed as for binary N:M relationships: create a new relation with as many foreign keys as there are entities in the relationship, etc.10/7/97 E-6Attributes•Simple attributes map unchanged–As noted, relationship attributes migrate to an entity (usually the "weaker" or "smaller" one)•Compound attributes–Break into individual items•"address" -> "street", "city", "state", "zip"•Multivalued attributes–Create a relation which joins primary key with each occurring value of the


View Full Document

UW CSE 444 - Lecture Notes

Documents in this Course
XML

XML

48 pages

SQL

SQL

25 pages

SQL

SQL

42 pages

Recovery

Recovery

30 pages

SQL

SQL

36 pages

Indexes

Indexes

35 pages

Security

Security

36 pages

Wrap-up

Wrap-up

6 pages

SQL

SQL

37 pages

More SQL

More SQL

48 pages

SQL

SQL

35 pages

XML

XML

46 pages

Triggers

Triggers

26 pages

Load more
Download Lecture Notes
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 Lecture Notes 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 Lecture Notes 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?