chapter3 part1

chapter3 part1 - Outline Chapter 3 The Relational Database...

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

View Full Document Right Arrow Icon
Chapter 3 The Relational Database Model BUS 173 Winter 2011 Dr. Hamouda Outline Relational model basics review Keys Integrity rules Relational Algebra Data redundancy & relational databases Indexing 3 Relational models Relational database model is easier to understand than hierarchical and network models View data logically rather than physically Allow the database designer to focus on the logical representation of the data and relationships rather than on the physical storage Logical view of relational database is based on relation Relation are implemented as tables in a relational DBMS 4 Tables and Their Characteristics A table: Resembles a file conceptually Two-dimensional structure composed of rows (tuples) and columns (attributes) All values in a column must conform to the same data format Each column has a specific range of values known as the attribute domain The order of the rows and columns is not important Each table must have an attribute or a set of attributes that uniquely identify each row. 5 Keys Each row in a table must be uniquely identifiable key Key is One or more attributes that determine other attributes Used to establish relationships between tables Used to ensure the integrity of the data. 6 Keys Key ’s role is based on determination If you know the value of attribute A, you can determine the value of attribute B Functional dependence Attribute B is functionally dependent on A if each value in column A determine one and only one value in column B Notation: A B read A determines B
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
7 An example of student classification: students are classified according to number of hours completed Keys STU_HRS STU_CLASS STU_HRS STU_CLASS Keys Composite key: Composed of more than one attribute Superkey: Any key that uniquely identifies each row Exp. ST_NUM; ST_NUM, STU_LNAME; ST_NUM, STU_LNAME, STU_INIT Candidate key: A superkey without unnecessary attributes Exp. ST_NUM ST_FNAME, STU_LNAME, STU_INIT, STU_PHONE Key attribute: Any attribute that is part of a key Keys Primary key (PK): One or many attributes that determine a row in a unique way Foreign key ( FK ): An attribute (column(s)) whose values match the values in a candidate
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 6

chapter3 part1 - Outline Chapter 3 The Relational Database...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online