0% found this document useful (0 votes)
255 views52 pages

KT24603 Mod03

Uploaded by

Richie Roy Roy
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)
255 views52 pages

KT24603 Mod03

Uploaded by

Richie Roy Roy
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/ 52

Database Systems:

Design,
Implementation, and
Management, 14e
Module 3: The Relational Database
Model

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 1
Chapter Objectives (1 of 2)

By the end of this chapter, you should be able to:

1. Describe the relational database model’s logical structure

2. Identify the relational model’s basic components and explain the structure, contents, and characteristics
of a relational table

3. Use relational database operators to manipulate relational table contents

4. Explain the purpose and components of the data dictionary and system catalog

5. Identify appropriate entities and then the relationships among the entities in the relational database
model

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 2
Chapter Objectives (2 of 2)

By the end of this chapter, you should be able to (continued):

6. Describe how data redundancy is handled in the relational database model

7. Explain the purpose of indexing in a relational database

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 3
A Logical View of Data
• The relational data model allows the designer to focus on the logical representation of the data and
its relationships, rather than on the physical storage details
• The logical view is facilitated by the creation of data relationships based on a logical construct called
a relation
− It stores data in a concept of tables

• Logical simplicity yields simple and effective database design methodologies

• Simplest way to understand this is you are grouping the data in forms of tables which are related to
each other

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 4
Tables
• I repeat ! Simplest way to understand this is you are grouping the data in forms of tables which are
related to each other

ID Name Program
B
A

D
C

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 5
Tables and Their Characteristics (1 of 2)
• A table is perceived as a two-dimensional structure composed of rows and columns

• A table is also called a relation

• You can think of a table as a persistent representation of a logical relation


− A relation whose contents can be permanently saved for future use

• The domain is the set of allowable values for an attribute (e.g. program from the previous slide are
attributes that can have limited / allowable values)

• The primary key (PK) is an attribute or combination of attributes that uniquely identifies any given row
(i.e. the most unique one)

• The characteristics of a relational table are summarized in Table 3.1 on the following slide

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 6
Tables and Their Characteristics (2 of 2)
Table 3.1 Characteristics of a Relational Table
1 A table is perceived as a two-dimensional structure composed of rows and columns
2 Each table row (tuple) represents a single entity occurrence within the entity set
3 Each table column represents an attribute, and each column has a distinct name
4 Each intersection of a row and column represents a single data value
5 All values in a column must conform to the same data format
6 Each column has a specific range of values known as the attribute domain
7 The order of the rows and columns is immaterial to the DBMS
8 Each table must have an attribute or combination of attributes that uniquely identifies each row

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 7
Objective of using Relational Databases

• To allow a high degree of data independence and database model’s structural


− As said, building data logically, i.e. related data grouped together
• The logical view allows a simpler file concept of data storage.
• The use of logically independent tables is easier to understand.
• Logical simplicity yields simpler and more effective database design methodologies.
• To provide substantial grounds for dealing with data semantics, consistency and redundancy
problems

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 8
Keys
• A key consists of one or more attributes that determine other attributes
− In short, if I say ID you can identify who am I talking about, what’s their name etc
− So, ID is a key that can determine name, program, etc
− Another example, you go to McD, order some burgers, the receipt will show your Order ID. Whenever
the buzzer buzz your number, you know your burgers are ready
− So, again, Order ID is a key. We can know what you order based on that order number.

• Keys are important because they are used to ensure that each row in a table is uniquely identifiable
− They are also used to establish relationships among tables and to ensure the integrity of the data

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 9
Dependencies

• The role of a key is based on the concept of determination, which is the state in which knowing the
value of one attribute helps to determine the value of another

• Functional dependence means that the value of one or more attributes determines the value of one or
more other attributes (via the symbol ‘->’)

• The attribute whose value determines another is called the determinant or the key
− Eg: studID -> studName, studProgram,

• The attribute whose value is determined by the other is called the dependent
− Eg: studID -> studName, studProgram

• Full functional dependence is used to refer to functional dependencies in which the entire collection of
attributes in the determinant is necessary for the relationship
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 10
Dependencies (cont.)
• A functional dependency is a particular relationship between two attributes.

• That is, for any relation R, attribute B is functionally dependent on attribute A if, for every valid instance
of A, that value of A uniquely determines the value of B.

• This is usually represented by an arrow, as follows:

A  B

Dependent
Determinant

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 11
Example
• Remember: a functional dependency is a particular relationship between two attributes.

• Where A  B

• icNo  name

• custNo  custName, custAdress, custPhoneNo

• invoiceNo  invoiceDate, custNo, orderNo

• studNo  studName, studProg, studCGPA

• So, custNo, invoiceNo and studNo are examples of determinants

• And you can say that these values are unique enough to identify the whole relation

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 12
So, Keys
• Keys consist of one or more attributes that determine other attributes
− Ensure that each row in a table is uniquely identifiable

• Where A  B

• Therefore, keys are determinants in functional dependencies

• Primary key (PK): attribute or combination of attributes that uniquely identifies a row
Name ID CGPA
Ali BI12 3.5
PK?
Foo BI13 3.52
Prem BI14 3.45

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 13
Types of Keys (1 of 3)
• Several different types of keys are used in the relational model

• An attribute that is part of a key is called a key attribute

• A composite key is a key that is composed of more than one attribute

• custNo  custName, custAdress, custPhoneNo

• invoiceNo  invoiceDate, custNo, orderNo

• studNo  studName, studProg, studCGPA

• (studFName, studLName, studDOB)  studCGPA

• (staffName, staffDOB, staffYOS)  increment

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 14
Types of Keys (1 of 3)

• A superkey is an attribute, or combination of attributes, that uniquely identifies each row in a table.

• A candidate key is a minimal superkey; that is, a key that does not contain a subset of attributes that is
itself a superkey

• Entity integrity is the condition in which each row in the table has its own known, unique identity

• A null is the absence of any data value, and it is never allowed in any part of a primary key

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 15
Types of Keys (2 of 3)
• A null could represent any of the following:
− An unknown attribute value
− A known, but missing, attribute value
− A “not applicable” condition

• A foreign key (FK) is a primary key of one table that has been placed in another table

• Referential integrity is a condition by which a dependent table’s foreign key entry must have either a
null entry or a matching entry in the primary key of the related table

• A secondary key is a key that is used strictly for data retrieval purposes and does not require a functional
dependency

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 16
Types of Keys (3 of 3)

Figure 3.2 An Example of a Simple


Relational Database

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 17
Example
Sid Name Program Semest Gend Age Desc Result
me er er
Superkeys an attribute, or set of (Sid)
001 Jones BIT 4 M 20 attributes, that uniquely (Name)
identifies a tuple within (Sid, Name)
002 Parks BIT 4 M 21 a relation.
003 Baker BCP 3 M 19 Candidate unique and irreducible (Sid)
keys (Name)
004 Rusell BCP 3 M 20
Primary key a candidate key that is (Sid)
005 Rye DSE 3 M 18 selected to identify
tuples uniquely within
006 Susan BIT 4 F 20 the relation.
007 Diana DSE 3 F 19
008 Juliet DCS 3 F 17
009 Rafael DCS 3 M 19

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 18
Knowledge Check Activity 3-1

• What is the difference between a database and a table?

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 19
Knowledge Check Activity 3-1: Answer

• What is the difference between a database and a table?


• Answer: A table, a logical structure that represents an entity set, is only one of the
components of a database. A table stores the end-user data.
• The database is a structure that houses one or more tables and metadata. The metadata
are data about data. Metadata include the data (attribute) characteristics and the
relationships between the entity sets.

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 20
Integrity Rules (1 of 2)
Table 3.4 Integrity Rules
Entity Integrity Description

Requirement All primary key entries are unique, and no part of a primary key may be null.

Purpose Each row will have a known, unique identity, and foreign key values can properly reference primary key values.

Example No invoice can have a duplicate number, nor can it be null; in short, all invoices are uniquely identified by their invoice number.

Referential Integrity Description

Requirement A foreign key may have either a null entry, as long as it’s not part of its table’s primary key, or an entry that matches the primary key value in a table to
which it is related.
Every non-null foreign key value must reference an existing primary key value.
Purpose The purpose is to ensure that every reference by a foreign key is a valid reference to the related primary key. It is possible for an attribute not to have a
corresponding value, but it will be impossible to have an invalid entry; the enforcement of the referential integrity rule makes it impossible to delete a
row in one table whose primary key has mandatory matching foreign key values in another table.
Example A customer might not yet have an assigned sales representative (number), but it will be impossible to have an invalid sales representative (number).

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 21
Integrity Rules (2 of 2)

Figure 3.3 An Illustration of Integrity


Rules

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 22
Relational Algebra

• Name sounds so maths but it is NOT entirely – just a bit

• Theoretical way of manipulating table contents using relational operators

• Relational algebra is a set of mathematical principles that form the basis for manipulating relational table
contents

• The following are the eight main functions:


− SELECT, PROJECT, JOIN, INTERSECT, UNION, DIFFERENCE, PRODUCT, and DIVIDE

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 23
Formal Definitions and Terminology

• A relation is the data that you see in your tables

• A relvar (short for relation variable) is a variable that holds a relation

• A relvar has the following two parts:


− The heading contains the names of the attributes
− The body contains the relation
− Eg: r(Rn)
− STUDENT(studID, studName, studProgram)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 24
Relational Set Operators (1 of 7)
• Figure 3.4 SELECT
• SELECT is an operator used
to select a subset of rows
• Also known as RESTRICT

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 25
Relational Set Operators

• Figure 3.5 PROJECT


• PROJECT is an operator used to
select a subset of columns

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 26
Relational Set Operators (2 of 7)
• Figure 3.6 UNION

• UNION is an operator used to merge two tables into a new table, dropping duplicate rows

• The tables must be union-compatible


− When two or more tables share the same number of columns and when their corresponding columns
share the same or compatible domains

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 27
Relational Set Operators

• Figure 3.7 INTERSECT


• INTERSECT is an operator used to yield only the rows that are common to two
union-compatible tables

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 28
Relational Set Operators (3 of 7)

• Figure 3.8 DIFFERENCE


• DIFFERENCE is an operator used to yield all rows from one table that are not
found in another union-compatible table

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 29
Relational Set Operators
• Figure 3.9 PRODUCT
• PRODUCT is an operator used to yield all possible pairs of rows from two tables

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 30
Relational Set Operators (4 of 7)
• Figure 3.10 Two Tables that Will be Used in JOIN
Illustrations
• JOIN allows information to be intelligently
combined from two or more tables

• Figure 3.11 Natural JOIN, Step 1: PRODUCT


• A natural join links tables by selecting only the
rows with common values in their common
attribute(s)

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 31
Relational Set Operators (5 of 7)
• Figure 3.12 Natural JOIN, Step 2: SELECT
• A SELECT is performed on the output of
Step 1 to yield only the rows for which the
AGENT_CODE values are equal

• Figure 3.13 Natural JOIN, Step 3: PROJECT


• A PROJECT is performed on the results of Step 2 to
yield a single copy of each attribute (i.e remove
duplicates)

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 32
Relational Set Operators (7 of 7)
• Figure 3.16 DIVIDE
• The DIVIDE operator
− Uses one double-column table as the dividend and one single-column table as the divisor
− Output is a single column that contains all values from the second column of the dividend that
are associated with every row in the divisor

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 33
Divide

The only CUS_CODE that is associated the


P_CODE is …

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 34
Time to take 10

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 35
The Data Dictionary and the
System Catalog
• The data dictionary provides a detailed description of all tables in the database created by the user and
designer
− It is sometimes described as “the database designer’s database” because it records the design
decisions about tables and their structures

• The system catalog is a detailed system data dictionary that describes all objects within the database

• Homonyms and synonyms must be avoided to lessen confusion


 Homonym – same name is used to label different attributes
 Synonym – different names are used to describe the same attribute

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 36
Relationships within the Relational Database (1 of
6)
• The one-to-many (1:M) relationship is the norm for relational databases

• In the one-to-one (1:1) relationship, one entity can be related to only one other entity and vice versa

• The many-to-many (M:N) relationship can be implemented by creating a new entity in 1:M relationships
with the original entities
− A composite entity (i.e., bridge or associative or linkup entity) helps avoid problems inherent to
M:N relationships
 It includes the primary keys of tables to be linked
 i.e. the linkup tables

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 37
• 1:1

• Some sample data?


DEPARTMENT
PROFESSOR DEPT
FKI
ZHAS FKI
FKAL
SA FKI
FKJ
ABU FKJ

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 38
STUDENT ID NAME
BI123 Muthu
BI222 Ali
M:N BI111 Chong

STUDENT CODE CLASS


ID
1:M M:1 BI123 KT24603 Database
i.e. bring PK BI123 KT11603 OOP
over to bridging
entity (ENROLL) BI111 KT11603 OOP

STUDENT ID NAME STUDENT CLASS CODE CLASS


BI123 Muthu BI123 Database KT24603 Database
BI222 Ali BI123 OOP KT11603 OOP
BI111 Chong BI111 OOP KT34403 HCI

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 39
1:M

1:M M:1

• Totally good example for this Database class

• Hint: your project

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 40
See the data
• Figure 3.27 The
Expanded ER Model

• Figure 3.28 The


Relational Diagram for
the Ch03_TinyCollege
Database

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 41
Data Redundancy Revisited (1 of 2)

• The relational database facilitates control of data redundancies through use of foreign keys
− Recall that foreign keys are common attributes that are shared by tables

• Data redundancy should be controlled except in the following circumstances:


− Sometimes data redundancy must be increased to make the database serve crucial information
purposes
− Sometimes data redundancy exists to preserve the historical accuracy of data

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 42
Data Redundancy Revisited (2 of 2)
• Figure 3.29 A Small Invoicing System

- Chances that these attributes (cus_code, pro_code) will be repeatedly is there


- But at least just the code, not the name, description, price etc.
- So, redundancy is not that bad when you design properly

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 43
Indexes (1 of 2)
• In short, it’s like a pointer – points to whatever data that you are looking for

• If don’t have this – then have to search (view) all part of the database (time matters)

• An index is an orderly arrangement to logically access rows in a table


− Index key: index’s reference point that leads to data location identified by the key
− Each key points to the location of the data identified by the key
− Unique index: index key can have only one pointer value associated with it (i.e. one row only)

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 44
Indexes (2 of 2)

Figure 3.31 Components of an


Index

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 45
Cobb’s Relational Database Rules (1 of 2)
Table 13.8 Dr. Codd’s 12 Relational Database Rules

Rule Rule Name Description

1 Information All information in a relational database must be logically represented as column values in rows within tables.

2 Guaranteed access Every value in a table is guaranteed to be accessible through a combination of table name, primary key value,
and column name.
3 Systematic treatment of nulls Nulls must be represented and treated in a systematic way, independent of data type.

4 Dynamic online catalog based The metadata must be stored and managed as ordinary data—that is, in tables within the database; such data
on the relational model must be available to authorized users using the standard database relational language.
5 Comprehensive data The relational database may support many languages; however, it must
sublanguage support one well-defined, declarative language as well as data definition,
view definition, data manipulation (interactive and by program), integrity
constraints, authorization, and transaction management (begin, commit,
and rollback).
6 View updating Any view that is theoretically updatable must be updatable through the
system.
7 High-level insert, update, and delete The database must support set-level inserts, updates, and deletes.

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 46
Cobb’s Relational Database Rules (2 of 2)
Table 13.8 Dr. Codd’s 12 Relational Database Rules

Rule Rule Name Description

8 Physical data independence Application programs and ad hoc facilities are logically unaffected when physical access methods or storage
structures are changed.
9 Logical data independence Application programs and ad hoc facilities are logically unaffected when changes are made to the table
structures that preserve the original table values (changing order of columns or inserting columns).
10 Integrity independence All relational integrity constraints must be definable in the relational language and stored in the system
catalog, not at the application level.
11 Distribution independence The end users and application programs are unaware of and unaffected by the data location (distributed vs.
local databases).
12 Nonsubversion If the system supports low-level access to the data, users must not be allowed to bypass the integrity rules of
the database.
13 Rule zero All preceding rules are based on the notion that to be considered relational, a database must use its relational
facilities exclusively for management.

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 47
Knowledge Check Activity 3-3

• Explain why the data dictionary is sometimes called "the database designer's
database."

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 48
Knowledge Check Activity 3-3: Answer

• Explain why the data dictionary is sometimes called "the database designer's
database."
• Answer: Just as the database stores data that is of interest to the users regarding the
objects in their environment that are important to them, the data dictionary stores data
that is of interest to the database designer about the important decisions that were
made in regard to the database structure. The data dictionary contains the number of
tables that were created, the names of all of those tables, the attributes in each table, the
relationships between the tables, the data type of each attribute, the enforced domains of
the attributes, etc.

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 49
Summary (1 of 2)

Now that the lesson has ended, you should be able to:

1. Describe the relational database model’s logical structure

2. Identify the relational model’s basic components and explain the structure, contents, and characteristics
of a relational table

3. Use relational database operators to manipulate relational table contents

4. Explain the purpose and components of the data dictionary and system catalog

5. Identify appropriate entities and then the relationships among the entities in the relational database
model

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 50
Summary (2 of 2)

Now that the lesson has ended, you should be able to (continued):

6. Describe how data redundancy is handled in the relational database model

7. Explain the purpose of indexing in a relational database

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 51
Takeaways

• Tables are the basic building blocks of a relational database


− Keys are central to the use of relational tables
 Each table row must have a primary key
− Although tables are independent, they can be linked by common attributes

• The relational model supports several relational algebra functions


− A relational database performs much of the data manipulation work behind the scenes
− Once you know the basics of relational databases, you can concentrate on design

Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 52

You might also like