ITP311 Relational Databases
ITP311 Relational Databases
DATABASES
RELATIONAL DATABASES
■ Tuple
– Corresponds to a row of a table and an attribute or field to a column
■ Relation
– Is composed of fields (attributes) and tuples
– Are stored as tables in a relational database system
■ Attributes
– Are individual characteristics, and tuples form the unordered set of
characteristics that describe a particular entity
RELATIONAL DATABASES
■ Primary key
– is also called a major key
– Is the key field that serves as the unique identifier of a specific tuple in a relation
– Is the field which occupies the first column within a certain relation
■ Domain
– Is a pool of legal values for a given attribute
■ Foreign key
– Is a field in one table whose values are constrained to be values of the primary key in
another table.
– Is an attribute or a field of one relation whose values are required to match those of
the primary key of another location.
RELATIONAL DATABASES
Attribut
es
Relatio
n
RELATIONAL DATABASES
Emp_No Emp_Name Emp_Add Emp_Age
0001 Hagar Norway 24
Employee Foreign
0002 Honda Japan 25 Keys
Relation
0003 Ryu America 27
0004 Blanka Brazil 23 Emp_No Item_No Qty_Sold
0001 001 2
Item_No Item_Desc Qty_On_Hand 0001 007 1
001 Floor polisher 20 0002 005 2
005 Hair Dryer 12 0002 008 2
Items
007 Flat Iron 20 0002 009 1
Relation
008 Knife Set 5
009 Blender 20
DATA INTEGRITY RULES
■ Data integrity
– Refers to the trustworthiness of system resources over their entire life cycle
– Is “the representational faithfulness of information to the true state of the object
that the information represents, where representational faithfulness is composed
of four essential qualities or attributes: completeness, currency / timeliness,
accuracy / correctness and validity / authorization
Types of Data Integrity Rules