{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Week 4 (Wednesday and Friday)

Week 4 (Wednesday and Friday) - Relational Model The...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
8/3/2009 1 Relational Model The foundation of present day databases Session 4 y Relational model Enables us to view data logically rather than physically Similar to the simpler file concept of data storage Table A Logical View of Data y Has advantages of structural and data independence Resembles a file from conceptual point of view Easier to understand than its hierarchical and network database predecessors Characteristics of Tables y Table : two-dimensional structure composed of rows and columns y Contains a group of related entities Æ an entity set The terms entity set and table are often used interchangeably
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8/3/2009 2 Characteristics of Tables (cont.) cont.) y Think of a table as a persistent relation : y A relation whose contents can be permanently saved for future use Example Keys y Consist of one or more attributes that determine other attributes y Primary key (PK) is an attribute (or a combination of attributes) that uniquely identifies any given entity (row) y Key’s role is based on determination If you know the value of attribute A, you can look up (determine) the value of attribute B
Background image of page 2
8/3/2009 3 Keys ( cont. ) y Key attribute Any attribute that is part of a key y Composite key Composed of more than one attribute y Superkey Any key that uniquely identifies each entity y Candidate key A superkey without redundancies Null Values y No data entry Not permitted in primary key Should be avoided in other attributes y Can represent An unknown attribute value A known, but missing, attribute value A “not applicable” condition y Can create problems in logic and when using formulae y Null is not zero Controlled Redundancy y Makes the relational database work y Tables within the database share common attributes that enable us to link tables together (primary and foreign keys) Multiple occurrences of values in a table y are not redundant when they are required to make the relationship work y (Unwanted) redundancy is unnecessary duplication of data
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8/3/2009 4 Example Keys (cont.) cont.) y Foreign key (FK) An attribute whose values match primary key values in the related table y Referential integrity FK contains a value that refers to an existing valid tuple (row) in another relation y Secondary key Key used strictly for data retrieval purposes Integrity Rules
Background image of page 4
8/3/2009 5 An Illustration of Integrity Rules Relational Database Operators y Relational algebra
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}