Top Banner
Feb 26,2008 Fatimah Alakeel 1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes
33

Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Jan 03, 2016

Download

Documents

Allyson York
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 1

Database Design

Chapter-1- Basic ConceptsReference:

Prof. Mona Mursi Lecture notes

Dr.Lilac Safadi Lecture notes

Page 2: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 2

Database ConceptsDatabase ConceptsData is a meaningless static value. What does 3421 means?

Information is the data you process in a manner that makes it meaningful. Information can be provided only if proper data exists.

A database (DB) is a collection of related persistent data. Can be generated & maintained manually or automatically

Data is what you store in database. Information is what you retrieve from a database.

A database application is a collection of data and the programs that allow the manipulation of these data to meet the information needs of an enterprise

Page 3: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 3

Database Application: Database Application: ExamplesExamples

KSU Library

Saudia Airline Reservations

Car rental DB

A DB for all schools in Riyadh

 

Page 4: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 4

Database Properties Represents the real world (miniworld, Universe of Discourse UoD) Logically coherent collection of data. Designed, built, populated with data for a specific purpose. It has an

intended group of users and their applications. Can be of any size and any degree of complexity. Can be generated and maintained manually or using a computer.

A computerized DB can be created by: A Group of application programs Or by Database Management System (DBMS)

Page 5: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 5

The Data in the DB are

Shared by multiple users Stored less redundantly Made independent of applications Organized

Page 6: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 6

Database Management System (DBMS) A collection of programs that enables the users to create and

maintain a database. A general- purpose software system that facilitates the process of :

Defining (specifying data types, structures and constraints) Constructing (storing the data on a storage medium controlled

by DBMS) Manipulating (querying, update, generate reports) And Maintaining

The database for various applications .

Page 7: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 7

DBS EnvironmentDBS Environment

DatabaseMeta-Data

Data Access

Query Process

Application Programs

DBMS

DBS

Database System = Database + DBMS

Page 8: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 8

DBMS Capabilities & Responsibilities

1. Control redundancy.

2. Access a large amount of data efficiently.

3. Support a data model in which is conceptually captured.

4. Support HLL to define, access and manipulate data.

5. Provide correct access to data by multiple users.

6. Provide multiple users views.

7. Maintain data integrity.

8. Protect data.

9. Recover from failures.

Page 9: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 9

Database Management SystemDatabase Management System

Major Relational DBMS vendors/products

Paradox by Corel dBase, Clipper FoxPro, Access & SQL Server by MS MySQL DB2 by IBM Oracle, Sybase, Informix

Page 10: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 10

Advantages of Database Systems over Paper-Based Systems

1. Compactness

2. Speed

3. Less of hard work

4. Currency

Page 11: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 11

File-Based Systems (FBS)File-Based Systems (FBS)

FBS is a collection of application programs that perform tasks where each program defines and manages its own data.

DataEntry

Filehandling

File DefUser 1

Application Program 1 File1

DataEntry

Filehandling

File DefUser 2

Application Program 2 File 2

Page 12: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 12

File-Based Systems (FBS)File-Based Systems (FBS)

The limitations of the FBS approach attributed to two factors:

The definition of data is embedded in the application programs

There is no control over the access & manipulation of data beyond the imposed by the application program

Page 13: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 13

Differences between Files and a database

A database is self contained A database contains the description (system

catalog OR data dictionary OR meta data).

Page 14: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 14

File-Based Systems (FBS) File-Based Systems (FBS) DisadvantagesDisadvantages

1. Data Redundancy & Inconsistency Waste of space Cost of update Risk of inconsistency

2. Concurrent Access Anomalies3. Security Problems4. Integrity Problems5. Logical Data Dependence

Limited data sharing Inflexibility to access data Poor enforcement of standards

6. Physical Data Dependence Low programmer productivity Excessive program maintenance

Page 15: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 15

Database Systems Advantages

1. Minimal Data Redundancy

2. Logical Data Dependence Data sharing Multiple access path to data User views

3. Physical Data Dependence Application development is easy Less maintenance Good performance

4. Uniform control for security, privacy and integrity.

Page 16: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 16

Database Systems Advantages

5- Potential for enforcing standards DBA enforce standards for names and formats of data, display formats,

reports structures.

6- Reduced application development time Ex: Retrieval of data or printing a new report

7- Flexibility Change the structure without affecting the data and application programs

8- Up-to-date information is available All users access the DB. Once they save the changes the DB id available

to the other users

9- Economies of scale DBMS permits unification of data and application => reduce the cost of

operation and management

Page 17: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 17

Database Systems (DBS)Database Systems (DBS)

DBS is a single large repository of data, defined once & used by many application programs.

User 1

Application Program 1

DatabaseUser 2

Application Program 2

DataEntry

DataEntry

DBMS

Page 18: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 18

Characteristics of DB Approach

Self –Describing nature of a database system The database system contains:

Database Complete definition of the DB structure and constraints

(catalog)

Meta- Data Database

Catalog

DBMS

The DBMS works with any number of database applications

Page 19: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 19

Characteristics of DB Approach

Program-Data Independence In file based systems the structure of data files is

embedded in the access programs => any change to the structure may require changing all accessing programs

In DBMS any change in the structure does not require changing the access programs because the structure is stored in the DBMS catalog. => this is called program-data independence.

Page 20: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 20

Characteristics of DB Approach

Data Abstraction DBMS provides a conceptual representation

of the data => no much details about how the data is stored and how the operations are implemented.

There are different levels of abstraction.

Page 21: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 21

Characteristics of DB Approach

Data Abstraction

Physical Level

Conceptual Level

View 1 View 2 View 3 View N……..

How the data is stored in the

physical media (files of records

or structs)Implementers

What data is stored and how its

interrelated (tables or tree)

Database Administrators

Describe some parts of the databse

Users

Page 22: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 22

Data Models

Data Model is a set of concepts for describing the structure of a DB (data, relationships, constraints)

Used for the conceptual and view levels

Categories of data models:

- Object-based conceptual model

- Record-based logical model

- Physical model

Page 23: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 23

Categories of Data Models

Object-based conceptual model The structure of the database is flexible Data constraints specified explicitly Examples:

Entity Relationship Model (ER) Object Oriented Models (OO)

Characteristics: Entities represent things in the real world Entities are distinct New kind of entities can be constructed from old kinds

Page 24: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 24

Categories of Data Models

Record-based logical model Data viewed as a fixed- format records of

various types. Examples:

Relational model Network model Hierarchical model

Page 25: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 25

Data Models

Staff_No LName Salary Brn_No Brn_No Street Tel_No

St1 Name1 7000 1St2 Name2 4000 1St3 Name3 6500 2St4 Name4 3000 3

1 Olayaa 46300002 Malaz 47800003 Rawda 2310000

St1 Name1 7000 Olayaa 4630000

St2 Name2 4000

St3 Name3 6500

St4 Name4 3000

Malaz 4780000

Rawda 2310000

RelationalModel

NetworkModel

Page 26: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 26

Data Models

St3 Name3 6500

HierarchicalModel

St1 Name1 7000 St2 Name2 4000

St4 Name4 3000

Olayaa 4630000Malaz 4780000 Rawda 2310000

Page 27: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 27

Database Systems (DBS)Database Systems (DBS)

Staff_No FName LName DOB Salary Bno

Staff_No FName LName Age Salary Staff_No LName Bno

View 1 View 2

DBS Support of Multiple Views of Data

Virtual data derived from the data base

Page 28: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 28

Database Systems (DBS)Database Systems (DBS)

Sharing of data and multiuser transaction processing

DBMS includes concurrency control software => to ensure that several users trying to update the same data can do that in a controlled manner so the result of the update is correct.

Page 29: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 29

Actors in the SceneActors in the Scene

Database Administrator (DBA): administrates the DB, DBMS & related software

Database Designer: Identify the data & choose the appropriate structure to represent & store the data

Database user: Queries/modifies data- Naïve users: invoke one of the permanent application programs that have been written previously

- Sophisticated users: form requests in a database query language

Page 30: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 30

Actors in the SceneActors in the Scene System Analyst: determine the requirements of end users &

develop system specifications

Application Programmer: implement system specifications

DBMS designer & Implementers

Tool Developer

Operators & Maintenance Personnel

Page 31: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 31

DBS EnvironmentDBS Environment

DBMSApp

Program

DB

UserRequirement

Procedure

DBA

Naïve End User

Applicationprogrammer

DB Designer System Analyst

Sophisticated End User H/W

Design

Communicate

Manage

Write Write

Program

Use

Use

Page 32: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 32

When Not to Use a DBMS

High initial investment in H/W, S/W and training. Generality provided by DBMS for defining and

processing data. Overhead for providing security, concurrency

control, recovery and integrity functions. Database & applications are simple, well defined,

not expected to change. Real-time requirements can not be met because of

overhead. Multiple-user access to data is not required.

Page 33: Feb 26,2008Fatimah Alakeel1 Database Design Chapter-1- Basic Concepts Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes.

Feb 26,2008 Fatimah Alakeel 33

Chapter’s Summery

Definition of ( Data, Information ,Database, Database application).

Properties of (database, data stored in the database). DBMS definition, properties and responsibilities. File based system vs. database system Database system characteristics. Data models Actors in the scene. When not to use a DBMS.