Вы находитесь на странице: 1из 27

Advanced Database Concepts

ISE-830 (3+0)

Fundamental Concepts
Instructor

Dr Sharifullah Khan
September 2011

Database System
Data recorded facts with implicit meaning Database an integrated collection of data
preserved over a long period organized for access and modification

Data Base Management Systems (DBMS): GENERALISED software package designed to store and manage database
Defining, constructing and manipulating databases

Database System: database together with DBMS


Advanced Database Concepts 2

Why Use Models?


Models can be useful when we want to examine or manage part of the real world The costs of using a model are often considerably lower than the costs of using or experimenting with the real world itself Examples:
airplane simulator nuclear power plant simulator
Advanced Database Concepts 3

Data Model
Data abstraction hiding details of data storage A data model is a collection of concepts that can be used to describe the structure of a database:
Data structure, relationships and constraints

A data model provides the necessary means to achieve this abstraction


Advanced Database Concepts 4

Data Modeling
DATABASE SYSTEM REALITY structures processes data modeling MODEL

The model represents a perception of structures of reality The data modeling process is to fix a perception of structures of reality and represent this perception In the data modeling process we select aspects and we abstract
Advanced Database Concepts 5

Process Modeling
REALITY structures processes process modeling DATABASE SYSTEM MODEL

The use of the model reflects processes of reality Processes may be represented by programs with embedded database queries and updates Processes may be represented by ad-hoc database queries and updates at run-time
DML PROG DML

Advanced Database Concepts

Database Design
The purpose of database design is to create a database which
is a model of structures of reality supports queries and updates modeling processes of reality runs efficiently

Advanced Database Concepts

Data Model
A data model consists of notations for expressing:
data structures integrity constraints operations

Advanced Database Concepts

Categories of Data Models


Conceptual data model High Level.
Entity-Relationship model. Object data models. Entity, attributes and relationship.

Representational data model.


Relational data model. Record structure.

Physical data model Low Level.


Record formats, record ordering and access path.

Advanced Database Concepts

ER-Model
Data Structures Integrity Constraints Operations

The ER-Model is extremely successful as a database design model Translation algorithms to many data models Commercial database design tools, e.g., ERwin No generally accepted query language

ER-Model - Data Structures


entity type

composite attribute Relations hip type

attribute

subset relationshi p type

multivalued attribute

derived attribute

ER-Model - Integrity Constraints


E1 1 R n E2 A
key attribute cardinality: 1:n for E1:E2 in R (min,max)

E1

E2 E1

(min,max) participation of E2 in R

E2 d o p disjoint overlap partition

E3

E1

E2

total participation of E2 in R

E1

E2

weak entity type E2; identifying relationship type R

ER Model - Example
dept time airport name airport addr street city airport code airport 1 zip arriv time date arriv airport n 1 1 dept airport n p

visa required domestic international flight flight weekdays

flight schedule flight#

instance of n

customer# customer name customer n reservation

flight instance

seat#

ER-Model - Operations
Several navigational query languages have been proposed A closed query language as powerful as relational languages has not been developed None of the proposed query languages has been generally accepted

Relational Model
Data Structures Integrity Constraints Operations Commercial systems include: ORACLE,
DB2, SYBASE, INFORMIX, INGRES, SQL Server

Dominates the database market on all platforms


Advanced Database Concepts 15

Relational Model - Data Structures


domains attributes relations
relation name attribute names flight-schedule
flight#: integer airline: weekday: char(20) char(2) price: dec(6,2)

domain names
Advanced Database Concepts 16

Relational Model - Integrity Constraints



flight-schedule flight# p reservation flight# date customer# Advanced Database Concepts
17

Keys Primary Keys Entity Integrity Referential Integrity


customer customer# p customer name

Relational Model - Operations


Powerful set-oriented query languages Relational Algebra: procedural; describes how to compute a query; operators like
JOIN, SELECT, PROJECT

Relational Calculus: declarative; describes the desired result, e.g. SQL, QBE insert, delete, and update capabilities

Advanced Database Concepts

18

Normalization
FLIGHT-SCHEDULE
FLIGHT# 101 545 912 AIRLINE delta american scandinavian WEEKDAYS PRICE mo,fr mo,we,fr fr 156 110 450 FLIGHT-WEEKDAY FLIGHT# 101 545 912 101 545 PRICE 156 110 450 545 WEEKDAY mo mo fr fr we fr

FLIGHT-SCHEDULE
FLIGHT# 101 545 912 101 545 545 AIRLINE delta american scandinavian delta american american WEEKDAY mo mo

FLIGHT-SCHEDULE
FLIGHT# AIRLINE 101 545 912 delta american scandinavia n PRICE 156 110 450
19

fr fr we
fr

156 110
110

Advanced Database's Concepts

Schemas, Instances and Data State


Schema description of a database.
Frequently changes are unexpected. Schema construct STUDENT, COURSE.

Instances entities (records) of individual schema construct.


Frequently changed

Data state data at a particular moment in time


Current set of instances.
Advanced Database's Concepts 20

Instances and Data State


Student
Name Karim Naeem Student Number 17 8 Class 1 2 Major CS CS

Course CourseName Intro to Comp Science Data Structure Discrete Mathematics Database CourseNo CS1310 CS3320 MATH2410 CS3380 CreditHours Departmen t 4 4 3 3 CS CS MATH CS

Advanced Database's Concepts

21

Three-Schema Architecture
End users

External View
External/conceptual mapping

External View

Conceptual Schema
Conceptual/internal mapping Internal Schema

Stored Databases

Advanced Database's Concepts

22

Data Independence
Logical data independence:
Logical data independence is a measure of how much the conceptual schema can change without affecting the application programs

Physical data independence:


Physical data independence is a measure of how much the internal schema can change without affecting the application programs

Advanced Database Concepts

23

DBMS Languages
Data Definition Language (DDL). Data Manipulation Language (DML).
Non procedural DML high level.
Set-at-a-time.

Procedural DML low level.


Record-at-a-time.

Query Language High level DML, e.g. SQL.

Advanced Database Concepts

24

Classification of DBMSs -I
Data model:
Relational DBMSs. Object DBMSs. Object-relational DBMSs.

Number of users:
Single-user systems. Multi-user systems.

Advanced Database Concepts

25

Classification of DBMSs - II
Number of Sites:
Centralized DBMSs. Distributed DBMSs (DDBMSs).
Homegeneous DDBMSs. Hetrogeneous DDBMSs.

Advanced Database Concepts

26

The End Thanks for Your Attention

Advanced Database Concepts

27

Вам также может понравиться