Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Learning Objectives
In this chapter, one will learn:
That the relational database model offers a logical view
of data
About the relational models basic component:
relations
That relations are logical constructs composed of rows
(tuples) and columns (attributes)
That relations are implemented as tables in a relational
DBMS
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Learning Objectives
In this chapter, one will learn:
About relational database operators, the data dictionary,
and the system catalog
How data redundancy is handled in the relational
database model
Why indexing is important
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Keys
Consist of one or more attributes that determine other
attributes
Used to:
Ensure that each row in a table is uniquely identifiable
Establish relationships among tables and to ensure the
integrity of the data
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Determination
State in which knowing the value of one attribute
makes it possible to determine the value of another
Is the basis for establishing the role of a key
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Dependencies
Functional dependence: Value of one or more
attributes determines the value of one or more other
attributes
Determinant: Attribute whose value determines
another
Dependent: Attribute whose value is determined by the
other attribute
Types of Keys
Composite key: Key that is composed of more than
one attribute
Key attribute: Attribute that is a part of a key
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Types of Keys
Null: Absence of any data value that could represent:
An unknown attribute value
A known, but missing, attribute value
A inapplicable condition
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
10
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
11
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
12
vehicleID
carPlateNo
engineID
carName
101
WTY 1234
9999876
Proton Kembara
102
WXY 4567
5644321
Perodua Alza
103
CDA 3389
6667889
Proton Kembara
104
MCD 1745
1277653
Honda City
SUPERKEY
vehicleID, carPlateNo
vehicleID, engineID
vehicleID, carName
carPlateNo, engineID
carPlateNo, carName
engineID, carName
vehicleID, carPlateNo, engineID
vehicleID
carPlateNo
engineID
vehicleID
carPlateNo
engineID
carName
101
WTY 1234
9999876
Proton Kembara
102
WXY 4567
5644321
Perodua Alza
103
CDA 3389
6667889
Proton Kembara
104
MCD 1745
1277653
Honda City
CANDIDATE KEY
vehicleID, carPlateNo
vehicleID, engineID
carPlateNo, engineID
vehicleID
carPlateNo
engineID
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Integrity Rules
Entity Integrity
Description
Requirement
Purpose
Example
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
15
Integrity Rules
Referential Integrity
Description
Requirement
Purpose
Example
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
16
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
17
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
18
33
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
35
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
36
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
37
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
38
Data Redundancy
Relational database facilitates control of data
redundancies through use of foreign keys
To be controlled except the following circumstances
Data redundancy must be increased to make the
database serve crucial information purposes
Exists to preserve the historical accuracy of the data
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
39
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
40
Index
Orderly arrangement to logically access rows in a
table
Index key: Indexs reference point that leads to data
location identified by the key
Unique index: Index key can have only one pointer
value associated with it
2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
41