Week 3-1 Databas Introduction_temp

download Week 3-1 Databas Introduction_temp

of 15

Transcript of Week 3-1 Databas Introduction_temp

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    1/15

    Database

    Week 3-1

    Introduction of Database Management Systems

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    2/15

    Data Warehouse

    Customer No. Name Address Membership

    Product No. Product Name Price Description

    External Source

    MySQL

    ERD

    Data Mining

    Competitive Advantage Performance

    Good Business Decision Better Understanding

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    3/15

    Introduction of DBMS

    Database management system (DBMS)

    Consists of a collection of interrelated data and a set of programs toaccess that data

    Designed to manage large bodies of information

    Management of data involves Definition of structures for the storage of information

    Provision of mechanisms for the manipulation of information

    Provide safety of the information stored Collection of data

    is referred to as the database

    Contains information about one particular enterprise

    Goal of DBMS

    To provide an environment that is both convenient and efficient to use inretrieving and storing database information

    DBMS vs. typical file processing system File processing system

    Permanent records are stored in various files

    Number of different application programs are written to extract recordsfrom and add records to the appropriate files

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    4/15

    Purpose of Database Systems

    Data redundancy and inconsistency higher storage and access cost

    Difficulty in accessing data

    Conventional file-processing environments do notallow needed data to be retrieved in a convenient and

    efficient manner Data isolation

    Concurrent access anomalies

    Security problems

    Not every user should be able to access all the data Integrity problems

    Data values stored in the database must satisfycertain types of consistency constraints

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    5/15

    Data Abstraction

    Database management systems is a collectionof interrelated files and a set of programs that

    allow users to access and modify these files

    Major purpose of DBMS is to provide users with

    an abstract view of the data System hides certain details of how the data

    is stored and maintained

    Complexity of data structures is hidden from

    users through several levels of abstraction

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    6/15

    The Three Levels of Data Abstraction

    Physical level

    How the data are actually stored Complex low-level data structure are described in detail

    Conceptual level

    What data are actually stored

    Entire database is described in terms of a small number of

    relatively simple structure View level

    Describes only part of the entire database to further simplify usersinteraction with the system

    View 1 View 1 View 1

    Conceptual Level

    Physical Level

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    7/15

    Instances and Schemes

    Database change over time as information is insertedand deleted

    Instance

    The collection of information stored in the database ata particular moment in time

    Database Scheme The overall design of the database

    Schemes are changed infrequently

    Database systems have several schemes, partitioned

    according to the levels of abstraction In general, database systems support one physical

    scheme, one conceptual scheme and severalsubschems

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    8/15

    Data Independence

    Data independence The ability to modify a scheme definition in one level

    without a scheme definition in the next higher level

    Physical data independence

    The ability to modify the physical scheme without

    causing application programs to be rewritten Modifications at the physical level are occasionally

    necessary in order to improve performance

    Logical data independence

    The ability to modify the conceptual scheme withoutcausing application programs to be rewritten

    Modifications at the conceptual level are necessarywhenever the logical structure of the database isaltered

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    9/15

    Data Definition Language

    Data definition language A set of definitions which are expressed by a

    special language and specify database

    scheme

    The result of compilation of DDL statements isa set of tables which are stored in a special

    file called data dictionary

    Data dictionary

    A file that contains metadata (data about data)

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    10/15

    Data Manipulation Language

    Data Manipulation The retrieval of information stored in the database

    The insertion of new information into the database

    The deletion of information from the database

    The modification of data stored in the database

    Data Manipulation Language (DML)

    Enables users to access or manipulate data asorganized by the appropriate data model

    Procedural DML / Nonprocedural DML Depending on whether DML require a user to specify what

    data is needed and how to get it

    Query A statement requesting the retrieval of information

    Query Language

    Portion of a DML that involves information retrieval

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    11/15

    Database Manager

    Database Manager

    A program module which provides the interface between the low-level data stored in the database and the application programsand queries submitted to the system

    Interaction with the file manager

    Translates the various DML statements into low-level file system

    commands Responsible for actual storing, retrieving, and updating of data in

    the database

    Integrity enforcement

    Determine whether updates to the database result in theviolation of the constraint

    Security enforcement

    Backup and recovery

    Concurrency control

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    12/15

    Database Administrator

    Database administrator A person having central control of both data and

    programs accessing that data

    Functions of the database administrator

    Scheme definition Translated by the DDL compiler to a set of tables that are

    permanently stored in the data dictionary

    Storage structure and access method definition

    Scheme and physical organization modification

    Granting of authorization for data access

    Integrity constraint specifications

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    13/15

    Overall System Structure

    Functional components of a database system

    File manager Manages the allocation of space on disk storage and the data

    structures used to represent information stored on disk

    Database manager Provides the interface between the low-level data stored in the

    database and the application programs and queries submitted to the

    system Query processor

    Translates statements in a query language into low-levelinstructions that the database manager understands

    Attempts to transform a users request into an equivalent but moreefficient form

    DML precompiler Converts DML statements embedded in an application program to

    normal procedure calls in the host language

    DDL compiler Converts DDL statements to a set of tables containing metadata

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    14/15

    Overall System Structure (2)

    Several data structures are required as part ofthe physical system implementation

    Data files

    Stores the database itself

    Data dictionary Stores metadata about the structure of the

    database

    Indices

    Provide for fast access to data items holding

    particular values

  • 8/7/2019 Week 3-1 Databas Introduction_temp

    15/15

    System Structure

    data dictionary

    data files

    file manager

    DDL compilerquery

    processor

    database

    manager

    application

    programs

    object code

    DML precompiler

    application

    interfaces

    application

    programsquery

    database

    scheme

    naive users application programmers sophisticated users database administrator

    disk storage