+ All Categories
Home > Documents > Fundamental DB Concepts

Fundamental DB Concepts

Date post: 06-Apr-2018
Category:
Upload: sherdil74
View: 228 times
Download: 0 times
Share this document with a friend

of 27

Transcript
  • 8/3/2019 Fundamental DB Concepts

    1/27

    Advanced Database ConceptsISE-830 (3+0)

    Fundamental Concepts

    Instructor

    Dr Sharifullah KhanSeptember 2011

  • 8/3/2019 Fundamental DB Concepts

    2/27

    Advanced Database Concepts 2

    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

  • 8/3/2019 Fundamental DB Concepts

    3/27

    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

  • 8/3/2019 Fundamental DB Concepts

    4/27

    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 meansto achieve this abstraction

    Advanced Database Concepts 4

  • 8/3/2019 Fundamental DB Concepts

    5/27

    Data Modeling

    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

    REALITY

    structures

    processes

    DATABASE SYSTEM

    MODEL

    data modeling

  • 8/3/2019 Fundamental DB Concepts

    6/27

    Advanced Database Concepts 6

    Process Modeling

    REALITY

    structures

    processes

    DATABASE SYSTEM

    MODEL

    process modeling

    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-timeDML DML

    PROG

  • 8/3/2019 Fundamental DB Concepts

    7/27

    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 7

  • 8/3/2019 Fundamental DB Concepts

    8/27

    Data Model

    A data model consists of notations for

    expressing:

    data structures

    integrity constraints

    operations

    Advanced Database Concepts 8

  • 8/3/2019 Fundamental DB Concepts

    9/27

    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 9

  • 8/3/2019 Fundamental DB Concepts

    10/27

    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

  • 8/3/2019 Fundamental DB Concepts

    11/27

    ER-Model - Data Structures

    entity type

    Relations

    hip type

    attribute

    multivalued

    attribute

    derived

    attribute

    composite

    attribute

    subsetrelationshi

    p type

  • 8/3/2019 Fundamental DB Concepts

    12/27

    ER-Model - Integrity Constraints

    A

    E

    E1 E3E2

    RE1 E21 n

    RE1 E2

    RE1E2

    (min,max)

    RE1 E2R

    cardinality: 1:n for E1:E2 in R

    (min,max) participation of E2 in R

    total participation of E2 in R

    weak entity type E2; identifying

    relationship type R

    key attribute

    d

    op

    disjoint

    overlap

    partition

  • 8/3/2019 Fundamental DB Concepts

    13/27

    ER Model - Example

    deptairport

    date

    internationalflight

    domesticflight

    p

    flightinstance

    flightschedule

    instanceof

    arrivairport

    airport

    1

    n

    n

    1

    street

    depttime

    airportcode

    arrivtime

    city zip

    airportaddr

    airportname

    reserva-tion

    nn

    1

    n

    customer

    flight#

    customername

    customer#

    seat#

    weekdays

    visarequired

  • 8/3/2019 Fundamental DB Concepts

    14/27

    ER-Model - Operations

    Several navigational query languages have

    been proposed

    A closed query language as powerful asrelational languages has not been developed

    None of the proposed query languages has

    been generally accepted

  • 8/3/2019 Fundamental DB Concepts

    15/27

    Relational Model

    Data Structures

    Integrity Constraints

    Operations

    Commercial systems include: ORACLE,DB2, SYBASE, INFORMIX, INGRES, SQL

    Server

    Dominates the database market on allplatforms

    Advanced Database Concepts 15

  • 8/3/2019 Fundamental DB Concepts

    16/27

    Advanced Database Concepts 16

    Relational Model - Data Structures

    domains

    attributes

    relations

    flight-scheduleflight#:

    integer

    airline:

    char(20)

    weekday:

    char(2)

    price:

    dec(6,2)

    relation name

    attribute

    names

    domain names

  • 8/3/2019 Fundamental DB Concepts

    17/27

    Advanced Database Concepts 17

    Relational Model - Integrity Constraints

    Keys

    Primary Keys

    Entity Integrity

    Referential Integrity

    reservation

    flight# date customer#

    flight-schedule

    flight#

    p

    customer

    customer# customer name

    p

  • 8/3/2019 Fundamental DB Concepts

    18/27

    Relational Model - Operations

    Powerful set-oriented query languages

    Relational Algebra: procedural; describes

    how to compute a query; operators likeJOIN, SELECT, PROJECT

    Relational Calculus: declarative; describes

    the desired result, e.g. SQL, QBE

    insert, delete, and update capabilities

    Advanced Database Concepts 18

  • 8/3/2019 Fundamental DB Concepts

    19/27

    Advanced Database's Concepts 19

    Normalization

    FLIGHT# AIRLINE PRICE

    FLIGHT-SCHEDULE

    101 delta 156

    545 american 110

    912 scandinavia

    n

    450

    FLIGHT# AIRLINE WEEKDAY PRICE

    FLIGHT-SCHEDULE

    101 delta mo

    545 american mo 110

    912 scandinavian fr 450

    156

    101 delta fr 156545 american we 110545 american fr 110

    FLIGHT# AIRLINE WEEKDAYS PRICEFLIGHT-SCHEDULE

    101 delta mo,fr 156

    545 american mo,we,fr 110

    912 scandinavian fr 450

    FLIGHT# WEEKDAY

    FLIGHT-WEEKDAY

    101 mo

    545 mo

    912 fr

    101 fr

    545 we

    545 fr

  • 8/3/2019 Fundamental DB Concepts

    20/27

    Advanced Database's Concepts 20

    Schemas, Instances and Data State

    Schema description of a database.

    Frequently changes are unexpected.

    Schema construct STUDENT, COURSE.

    Instances entities (records) of individualschema construct.

    Frequently changed

    Data state data at a particular moment intime

    Current set of instances.

  • 8/3/2019 Fundamental DB Concepts

    21/27

    Advanced Database's Concepts 21

    Instances and Data State

    Student

    Name Student Number Class Major

    Karim 17 1 CS

    Naeem 8 2 CS

    Course

    CourseName CourseNo CreditHours Departmen

    t

    Intro to Comp Science CS1310 4 CS

    Data Structure CS3320 4 CSDiscrete Mathematics MATH2410 3 MATH

    Database CS3380 3 CS

  • 8/3/2019 Fundamental DB Concepts

    22/27

    Advanced Database's Concepts 22

    Three-Schema Architecture

    Internal Schema

    Conceptual Schema

    External View External View

    End users

    Stored Databases

    Conceptual/internal mapping

    External/conceptual

    mapping

  • 8/3/2019 Fundamental DB Concepts

    23/27

    Advanced Database Concepts 23

    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

  • 8/3/2019 Fundamental DB Concepts

    24/27

    Advanced Database Concepts 24

    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.

  • 8/3/2019 Fundamental DB Concepts

    25/27

    Advanced Database Concepts 25

    Classification of DBMSs -I

    Data model:

    Relational DBMSs.

    Object DBMSs. Object-relational DBMSs.

    Number of users:

    Single-user systems.

    Multi-user systems.

  • 8/3/2019 Fundamental DB Concepts

    26/27

    Advanced Database Concepts 26

    Classification of DBMSs - II

    Number of Sites:

    Centralized DBMSs.

    Distributed DBMSs (DDBMSs). Homegeneous DDBMSs.

    Hetrogeneous DDBMSs.

  • 8/3/2019 Fundamental DB Concepts

    27/27

    Advanced Database Concepts 27

    The End

    Thanks for Your Attention


Recommended