The Relational Database Model

You might also like

You are on page 1of 7

Chapter 3: The relational database model

The relational database model is used in most of today's


commercial databases. It is used since the early 80s and was
developed in 1970 by E. F. Codd. The relational database model
is based on a mathematical concept where relations are
interpreted as tables that are flexible enough to allow data to be
manipulated into almost any configuration.
In contrast to the entity-relationship-model (ERM) which is a
conceptual model, the relational model is a logical data model. It
can be seen as lying one step or layer below the ERM. The
relational model is not about abstract objects but defines how
data should be represented in a specific database management
system. The goal of a logical data model is to arrange the data in
such a form that it is consistent, non-redundant and supports
operations for data manipulation.
Sections within relational model
1. logical view of data
 Automatic transmission replacing standard
 Data is presented in a table form
 Each row in a relational table is called a tuple
 While each column is an attribute

2. tables and their characteristics by user


 The user can manipulate and query the data in a way
that seems intuitive and logical
 Tables are related together through the sharing of
attributes although tables are independent of one
another, data can be easily associated between tables
(controlled redundancy)
 Relational tables stores a collection of related entities
 Files are collection of records of a single type
 The difference between a table and a file is that a table
yields complete data and structural independence
because it is a purely logical structure.
 Table has a name that is distinct from all other tables
in the database.
 There are no duplicate rows, each row is distinct.
 Entries in columns are atomic (no repeating groups or
multivalued attributes).
 Entries from columns are from the same domain based
on their data type: number (numeric, integer, float),
character (string), date logical (true or false)
 Operations combining different data types are
disallowed.
 Each attribute has a distinct name.
 Sequence of columns is insignificant.

3. Keys
 Relational types shown in a relational schema
 Relational diagram is a representation of the relational
database’s entities, attributes within those entities and
the relationship between those entities
 Powerful and structured query language (sql), allows
the user to specify what must be done without
specifying how it should to be done
Sql is divided into 3 parts
a) the user-end interface- interacting with data by auto-
generating sql code
b) a collection of tables stored in a database, each table is
independent, related by common values in common
attributes
c) sql engine executes all quarries and data requests

4. Integrity rules

5. Relational set operators


The relational operators have the property of closure; that
is, the use of relational algebra operators on existing
relations (tables) produces new relations. There is no need
to examine the mathematical definitions, properties, and
characteristics of those relational algebra operators.
However, their use can easily be illustrated as follows:
1. SELECT, also known as RESTRICT, yields values for
all rows found in a table that satisfy a given condition.
SELECT can be used to list all of the row values, or it can
yield only those row values that match a specified
criterion. In other words, SELECT yields a horizontal
subset of a table.
2. PROJECT yields all values for selected attributes. In
other words, PROJECT yields a vertical subset of a table.
3. UNIONUNION combines all rows from two tables,
excluding duplicate rows. The tables must have the same
attribute
characteristics (the columns and domains must be
compatible) to be used in the UNION. When two or more
tables share the same number of columns, and when their
corresponding columns share the same (or compatible)
domains, they are said to be union-compatible.
4. INTERSECT yields only the rows that appear in both
tables. As was true in the case of UNION, the tables must
be union-compatible to yield valid results. For example,
you cannot use INTERSECT if one of the attributes is
numeric and one is character-based.
5.DIFFERENCE yields all rows in one table that are not
found in the other table; that is, it subtracts one table from
the other. As was true in the case of UNION, the tables
must be union-compatible to yield valid results. However,
note that subtracting the first table from the second table is
not the same as subtracting the second table from the first
table.
6. PRODUCT yields all possible pairs of rows from two
tables—also known as the Cartesian product. Therefore,
if one table has six rows and the other table has three rows,
the PRODUCT yields a list composed of 6 × 3= 18 rows.
7. JOIN allows information to be combined from two or
more tables. JOIN is the real power behind the relational
database, allowing the use of independent tables linked by
common attributes.

6. Data dictionary and the system catalog


The data dictionary provides a detailed description of all
tables found within the user/designer-created database.
Thus, the data dictionary contains at least all of the attribute
names and characteristics for each table in the system. In
short, the data dictionary contains metadata—data about
data

7. Relationship within the relational database


Relations from database to user interface
a) The 1: M Relationship, 1 to many,
Microsoft access, one agent interacts with many customers
b) 1:1 relationship,

c) M: N relationship
Data redundancy
Security
Data inconsistency/ lacking data integrity
Data being accurate
Data being verified
Indexes
Codd’s relational database rules

Chapter 4: Entity relationship model


Entities
Attributes
Relationship
Connectivity and cardinality
Existence dependence
Relationship strength
Weak entities
Relationship participation
Relationship degree
Recursive relationships
Associative (composite) entities
Developing an ER diagram
Database design challenges: conflicting goals

 Table has a name that is distinct from all other tables in the database. •
 There are no duplicate rows, each row is distinct.
 Entries in columns are atomic (no repeating groups or multivalued
attributes)
 Entries from columns are from the same domain based on their data type:
number (numeric, integer, float), character (string), date logical (true or
false)
 Operations combining different data types are disallowed
 Each attribute has a distinct name
 sequence of columns is insignificant
 sequence of rows is insignificant

You might also like