0% found this document useful (0 votes)
7 views

Chapter3 RelationalDatabaseModel Part2

The document discusses the relational database model including its logical structure, basic components like tables and relations, and key concepts like functional dependencies, different types of keys like primary and foreign keys, and integrity rules enforced in relational databases.

Uploaded by

nassersalma496
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Chapter3 RelationalDatabaseModel Part2

The document discusses the relational database model including its logical structure, basic components like tables and relations, and key concepts like functional dependencies, different types of keys like primary and foreign keys, and integrity rules enforced in relational databases.

Uploaded by

nassersalma496
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Chapter 3

The Relational Database Model


CSC 3326
Learning Objectives
• After completing this chapter, you will be able to:
• Describe the relational database model’s logical structure
• Identify the relational model’s basic components and explain the structure, contents, and characteristics of a
relational table
• Use relational database operators to manipulate relational table contents
• Identify appropriate entities and then the relationships among the entities in the relational database model
Introduction
• Relational model = > the designer to focus on the logical representation of the data and its
relationships, rather than on the physical storage details.
• The relational model enables you to view data logically rather than physically.
• Logical simplicity yields simple and effective database design methodologies
• The logical view is facilitated by the creation of data relationships based on a logical construct
called a relation.
Introduction
• The relational model has three well-defined components:
 A logical data structure represented by relations/tables.
 A set of integrity rules to enforce that the data is consistent and remains consistent
over time.
 A set of operations that defines how data is manipulated
Introduction
• A table : a persistent representation of a relation.
• A table : a group of related entity occurrences—that is, an entity set.
Keys
• Keys consist of one or more attributes that determine other attributes
• Ensure that each row in a table is uniquely identifiable
• Establish relationships among tables and to ensure the integrity of the data

• The role of a key is based on the concept of determination


Determination/Dependencies

• Determination: state in which knowing the value of one attribute makes it possible
to determine the value of another attribute.
 Based on the relationships among the attributes

• 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

• Full functional dependence: entire collection of attributes in the determinant is


necessary for the relationship.
Determination/Dependencies
(Examples)

=>STU_NUM is the determinant and STU_LNAME is the dependent

=>It is a functional dependency and not a full functional dependency.

=>It is a full functional dependency.


Types of Keys
keys are determinants in functional dependencies.
Composite key: key that is composed of more than one attribute.
Key attribute: an attribute that is a part of a key

=> STU_NUM is a key composed of one key attribute.

=>(STU_LNAME, STU_FNAME, STU_INIT, STU_PHONE) is a composite key composed of


four key attributes.
Types of Keys
 Superkey: a key that can uniquely identify any row in the table => functionally determines the other attributes in
the row.
Þ STU_NUM, (STU_NUM, STU_LNAME), (STU_NUM, STU_LNAME, STU_INIT) and (STU_LNAME,
STU_FNAME, STU_INIT, STU_PHONE) are superkeys.
=> Any composite key that has STU_NUM as a key attribute will also be a superkey
 Candidate key: minimal superkey. A superkey without any unnecessary attributes => fully functionally determines
other attributes in the row.
ÞSTU_NUM is a candidate key
Þ(STU_NUM, STU_LNAME) is a superkey, but it is not a candidate
 A table can have many candidate keys.

Candidate keys are called candidates because they are the eligible options from which the designer will choose when
selecting the primary key.
Types of Keys
 Primary key: attribute or combination of attributes that uniquely identifies a row
 Relationships between tables are implemented through common attributes as a form of controlled
redundancy.
 Foreign key: is the primary key of one table that has been placed into another table to create a
common attribute.
Integrity Rules
• Integrity rules are needed to inform the DBMS about certain constraints in the real world.
• It is used to maintain the quality of data stored in a database.
• Relational database integrity rules are very important to good database design.
• Relational database management systems (RDBMSs) enforce integrity rules automatically.
Integrity Rules
• Entity integrity: condition in which each row in the table has its own unique identity.
• Referential integrity: every reference to an entity instance by another entity instance is
valid.
• Domain integrity: rules and other processes that restrict the format and type of data
recorded in the database.
 A domain is defined as a set of suitable values that a column is permitted to enclose.

You might also like