Revised by Ivor Perry - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Revised by Ivor Perry

Description:

Revised by Ivor Perry. Sept. 2003. Curtis and Cobham Ch 8. The Relational Model ... Revised by Ivor Perry. Sept. 2003. Curtis and Cobham Ch 8. Using a ... – PowerPoint PPT presentation

Number of Views:338
Avg rating:3.0/5.0
Slides: 18
Provided by: ivorp9
Category:
Tags: ivor | perry | revised

less

Transcript and Presenter's Notes

Title: Revised by Ivor Perry


1
The Relational Model
2
The Relational Model
  • Proposed by Codd in 1970 - Has a mathematical
    basis the term relation comes from this
  • Determining data structure.
  • Data is stored in a structure of relations
    (tables) defined by a data definition language
    (DDL).
  • The elements of data structure used in relational
    models are relations (tables), attributes, tuples
    (rows), and domains.
  • Defining data integrity.
  • Data integrity means that data remains stable,
    secure, and accurate.
  • It is maintained by internal constraints known as
    integrity rules that are invisible to users.

Curtis Cobham, Business Information Systems,
Prentice Hall Ch8
3
The Data Model
  • 3 Components

4
Manipulating Data
  • Relations can be manipulated and changed using a
    data manipulation language (DML) that employs
    relational operators.
  • These operators are based on the concepts of
    relational algebra.
  • Information is represented as two dimensional
    tables as below.

5
Another Example
Flight
6
Terminology
Flight
Domain set of values drawn upon by a particular
attribute Cardinality No. of Rows in a
relation Degree No. of Columns in a relation
Q Which is most likely to change?
7
Terminology
Flight
8
Terminology
Flight
Table type usually written as follows Flight
(Flight, Origin, Destination, Arrival)
9
Data Manipulation
  • Data manipulation is based on relational algebra,
    or relational calculus
  • not based on traversal of hierarchies or networks
  • 3 relational algebra operations
  • SELECT, PROJECT, JOIN
  • SELECT produces a new relation
  • consisting of selected rows from an existing
    relation
  • e.g. SELECT Flight WHERE Arrival gt11.00
  • PROJECT produces a new relation
  • consisting of a number of selected columns from
    an existing relation
  • e.g. PROJECT Flight OVER Flight_, Arrival

10
SELECT
11
PROJECT
12
A New Relation
Tour
13
Data Manipulation
  • Data manipulation is based on relational algebra,
    or relational calculus
  • not based on traversal of hierarchies or networks
  • 3 relational algebra operations
  • SELECT, PROJECT, JOIN
  • JOIN produces a new relation from 2 existing
    relations joined over a common domain
  • Take the first row from the first relation
    (.e.g.. Flight) and compare the attribute value
    with each attribute value in the second relation.
    If two values are identical, form a row by
    concatenating the first row with the row from the
    second relation ( strike out the repeat of the
    attribute)
  • e.g. JOIN FLIGHT and TOUR OVER Flight

14
JOIN
15
Using a relational Database
  • SQL
  • can be used for stand alone queries or embedded
    in programs written in various languages
  • QBE
  • Powerful tool to find data
  • uses the concept of examples (e.g. flight,
    destination) to find data (e.g. arrivalgt11.00)

16
Advantages
  • A clear concept of complex data relations
  • Allow powerful data manipulation and query
    languages
  • In table form - a natural representation of
    data
  • Data is accessed by value and conditions so the
    database can be accessed from any position
    (relation)
  • Access paths are not seen by the end user
  • Representation of the data is entirely logical

17
Disadvantages
  • The indexes used in implementation are often
    large and require heavy storage overheads
  • Operational speed of relational database systems
    can be slower than hierarchical or network
    databases
  • Note do not assume that, as some have said
    (Curtis 3rd edition), this makes them unsuitable
    for high volume processing.
  • (a trade-off between ideal and real-world
    conditions)
Write a Comment
User Comments (0)
About PowerShow.com