cs424 introduction of database system chapter 1,2 introduction to databases transparencies

32
CS424 Introduction of Database Sys CS424 Introduction of Database Sys tem tem Chapter 1,2 Chapter 1,2 Introduction to Databases Introduction to Databases Transparencies Transparencies

Post on 21-Dec-2015

225 views

Category:

Documents


0 download

TRANSCRIPT

CS424 Introduction of Database System CS424 Introduction of Database System

Chapter 1,2Chapter 1,2

Introduction to DatabasesIntroduction to Databases

TransparenciesTransparencies

CS424 Introduction of Database System CS424 Introduction of Database System

Chapter 1 - ObjectivesChapter 1 - Objectives

Some common uses of database systems.Some common uses of database systems. Characteristics of file-based systems.Characteristics of file-based systems. Problems with file-based approach.Problems with file-based approach. Meaning of the term database.Meaning of the term database. Meaning of the term Database Meaning of the term Database

Management System (DBMS).Management System (DBMS).

CS424 Introduction of Database System CS424 Introduction of Database System

Chapter 1 - Objectives Chapter 1 - Objectives

Typical functions of a DBMS.Typical functions of a DBMS. Major components of the DBMS Major components of the DBMS

environment.environment. Personnel involved in the DBMS Personnel involved in the DBMS

environment.environment. History of the development of DBMSs.History of the development of DBMSs. Advantages and disadvantages of DBMSs.Advantages and disadvantages of DBMSs.

CS424 Introduction of Database System CS424 Introduction of Database System

Examples of Database Examples of Database ApplicationsApplications

Purchases from the supermarketPurchases from the supermarket Purchases using your credit cardPurchases using your credit card Booking a holiday at the travel agents Booking a holiday at the travel agents Using the local libraryUsing the local library Taking out insuranceTaking out insurance Renting a videoRenting a video Using the InternetUsing the Internet Studying at universityStudying at university

CS424 Introduction of Database System CS424 Introduction of Database System

File-Based SystemsFile-Based Systems

Collection of application programs that Collection of application programs that perform services for the end users (e.g. perform services for the end users (e.g. reports). reports).

Each program defines and manages its Each program defines and manages its own data.own data.

CS424 Introduction of Database System CS424 Introduction of Database System

Files Base ProcessFiles Base Process

CS424 Introduction of Database System CS424 Introduction of Database System

File-Based ProcessingFile-Based Processing

1. Reading data from computer which scan the X-Ray

2. Weather data to be analyzed

3. The software which can read certain data and give you the output

CS424 Introduction of Database System CS424 Introduction of Database System

Limitations of File-Based Limitations of File-Based ApproachApproach

Separation and isolation of dataSeparation and isolation of data Each program maintains its own set of data.Each program maintains its own set of data. Users of one program may be unaware of Users of one program may be unaware of

potentially useful data held by other programs.potentially useful data held by other programs.

Duplication of dataDuplication of data Same data is held by different programs.Same data is held by different programs. Wasted space and potentially different values Wasted space and potentially different values

and/or different formats for the same item.and/or different formats for the same item.

CS424 Introduction of Database System CS424 Introduction of Database System

Limitations of File-Based Limitations of File-Based ApproachApproach

Data dependenceData dependence File structure is defined in the program code.File structure is defined in the program code.

Incompatible file formatsIncompatible file formats Programs are written in different languages, and so Programs are written in different languages, and so

cannot easily access each other’s files.cannot easily access each other’s files.

Fixed Queries/Proliferation of application Fixed Queries/Proliferation of application programsprograms Programs are written to satisfy particular functions.Programs are written to satisfy particular functions. Any new requirement needs a new program.Any new requirement needs a new program.

CS424 Introduction of Database System CS424 Introduction of Database System

Database ApproachDatabase Approach

Arose because:Arose because: Definition of data was embedded in application Definition of data was embedded in application

programs, rather than being stored separately and programs, rather than being stored separately and independently.independently.

No control over access and manipulation of data No control over access and manipulation of data beyond that imposed by application programs.beyond that imposed by application programs.

Result:Result: the database and Database Management System the database and Database Management System

(DBMS).(DBMS).

CS424 Introduction of Database System CS424 Introduction of Database System

DatabaseDatabase Shared collection of logically related data Shared collection of logically related data

(and a description of this data), designed (and a description of this data), designed to meet the information needs of an to meet the information needs of an organization.organization.

System catalog (metadata) provides System catalog (metadata) provides description of data to enable program–description of data to enable program–data independence.data independence.

Logically related data comprises entities, Logically related data comprises entities, attributes, and relationships of an attributes, and relationships of an organization’s information.organization’s information.

CS424 Introduction of Database System CS424 Introduction of Database System

Database Management System Database Management System (DBMS)(DBMS)

A software system that enables users to A software system that enables users to define, create, maintain, and control define, create, maintain, and control access to the database.access to the database.

(Database) application program: a (Database) application program: a computer program that interacts with computer program that interacts with database by issuing an appropriate database by issuing an appropriate request (SQL statement) to the DBMS.request (SQL statement) to the DBMS.

CS424 Introduction of Database System CS424 Introduction of Database System

Database Management System Database Management System (DBMS)(DBMS)

CS424 Introduction of Database System CS424 Introduction of Database System

Database ApproachDatabase Approach

Data definition language (DDL).Data definition language (DDL). Permits specification of data types, structures and Permits specification of data types, structures and

any data constraints. any data constraints. All specifications are stored in the database.All specifications are stored in the database.

Data manipulation language (DML).Data manipulation language (DML). General enquiry facility (query language) of the General enquiry facility (query language) of the

data.data.

CS424 Introduction of Database System CS424 Introduction of Database System

Database ApproachDatabase Approach

Controlled access to database may Controlled access to database may include:include:a security systema security systeman integrity systeman integrity systema concurrency control systema concurrency control systema recovery control systema recovery control systema user-accessible catalog.a user-accessible catalog.

CS424 Introduction of Database System CS424 Introduction of Database System

ViewsViews

Allows each user to have his or her own Allows each user to have his or her own view of the database.view of the database.

A view is essentially some subset of the A view is essentially some subset of the database.database.

CS424 Introduction of Database System CS424 Introduction of Database System

Views - BenefitsViews - Benefits

Reduce complexityReduce complexity Provide a level of securityProvide a level of security Provide a mechanism to customize the Provide a mechanism to customize the

appearance of the databaseappearance of the database Present a consistent, unchanging picture Present a consistent, unchanging picture

of the structure of the database, even if of the structure of the database, even if the underlying database is changedthe underlying database is changed

CS424 Introduction of Database System CS424 Introduction of Database System

Components of DBMS Components of DBMS EnvironmentEnvironment

CS424 Introduction of Database System CS424 Introduction of Database System

Components of DBMS Components of DBMS EnvironmentEnvironment

HardwareHardware Can range from a PC to a network of Can range from a PC to a network of

computers.computers. SoftwareSoftware

DBMS, operating system, network software (if DBMS, operating system, network software (if necessary) and also the application programs.necessary) and also the application programs.

DataDataUsed by the organization and a description Used by the organization and a description

of this data called the schema.of this data called the schema.

CS424 Introduction of Database System CS424 Introduction of Database System

Components of DBMS Components of DBMS EnvironmentEnvironment

ProceduresProcedures Instructions and rules that should be applied to Instructions and rules that should be applied to

the design and use of the database and DBMS.the design and use of the database and DBMS.

PeoplePeople

CS424 Introduction of Database System CS424 Introduction of Database System

Components of Database Components of Database Management System (DBMS)Management System (DBMS)

CS424 Introduction of Database System CS424 Introduction of Database System

DBMS ArchitectureDBMS Architecture

CS424 Introduction of Database System CS424 Introduction of Database System

DBMS ArchitectureDBMS Architecture

The Internal or Physical Level:The Internal or Physical Level: The collection of files permanently stored on The collection of files permanently stored on

secondary storage devices.secondary storage devices. And it provides a low-level description of the physical And it provides a low-level description of the physical

database, and an interface between the operating database, and an interface between the operating system's file system and the record structures used in system's file system and the record structures used in higher levels of abstraction. higher levels of abstraction.

At this level record types and methods of storage are At this level record types and methods of storage are defined, as well as how stored fields are represented.defined, as well as how stored fields are represented.

CS424 Introduction of Database System CS424 Introduction of Database System

DBMS ArchitectureDBMS Architecture The Conceptual Level:The Conceptual Level:

It presents a logical view of the entire database, which It presents a logical view of the entire database, which allows you to bring all the data in the database allows you to bring all the data in the database together and see it in a consistent manner. together and see it in a consistent manner.

The first stage in the design of a database is to define The first stage in the design of a database is to define the conceptual view, and a DBMS provides a data the conceptual view, and a DBMS provides a data definition language DDL for this purpose. definition language DDL for this purpose.

The data definition language used to create the The data definition language used to create the conceptual level must not specify any physical conceptual level must not specify any physical storage considerations that should be handled by the storage considerations that should be handled by the physical level. It should not provide any storage or physical level. It should not provide any storage or access details, but should define the information access details, but should define the information content content onlyonly..

CS424 Introduction of Database System CS424 Introduction of Database System

DBMS ArchitectureDBMS Architecture The External or View Level:The External or View Level:

It provides a window on the conceptual view which It provides a window on the conceptual view which allows the user to see only the data of interest to allows the user to see only the data of interest to them. them.

The user can be either an The user can be either an applicationapplication program or an program or an end end useruser. Any number of external views can be . Any number of external views can be defined and they can overlap each other. defined and they can overlap each other.

The System Administrator and the DBA are special The System Administrator and the DBA are special cases. Because they have responsibilities for the cases. Because they have responsibilities for the design and maintenance for the design and design and maintenance for the design and maintenance of the database, they at times need to maintenance of the database, they at times need to be able to see the entire database. The external and be able to see the entire database. The external and the conceptual view are functionally equivalent for the conceptual view are functionally equivalent for these two users. these two users.

CS424 Introduction of Database System CS424 Introduction of Database System

Roles in the Database Roles in the Database EnvironmentEnvironment

Data AdministratorData Administrator ( (DADA))Database Administrator (DBA)Database Administrator (DBA)Database Designers (Logical and Database Designers (Logical and

Physical)Physical)Application ProgrammersApplication ProgrammersEnd Users (naive and sophisticated)End Users (naive and sophisticated)

CS424 Introduction of Database System CS424 Introduction of Database System

History of Database SystemsHistory of Database Systems

First-generationFirst-generation Hierarchical and NetworkHierarchical and Network

Second generationSecond generation RelationalRelational

Third generationThird generation Object-RelationalObject-Relational Object-OrientedObject-Oriented

CS424 Introduction of Database System CS424 Introduction of Database System

DBs Hierarchical 1960sDBs Hierarchical 1960s The hierarchical data model organizes The hierarchical data model organizes

data in a tree structure. data in a tree structure. There is a hierarchy of parent and child There is a hierarchy of parent and child

data segments. data segments. This structure implies that a record can This structure implies that a record can

have repeating information, generally in have repeating information, generally in the child data segments. the child data segments.

Data in a series of records, which have Data in a series of records, which have a set of field values attached to it. It a set of field values attached to it. It collects all the instances of a specific collects all the instances of a specific record together as a record type. record together as a record type.

These record types are the equivalent of These record types are the equivalent of tables in the relational model, and with tables in the relational model, and with the individual records being the the individual records being the equivalent of rows. equivalent of rows.

To create links between these record To create links between these record types, the hierarchical model uses types, the hierarchical model uses Parent Child Relationships. These are a Parent Child Relationships. These are a 1:N1:N mapping between record types. mapping between record types. This is done by using trees, This is done by using trees,

CS424 Introduction of Database System CS424 Introduction of Database System

DBs Network 1970sDBs Network 1970s•data were more naturally modeled data were more naturally modeled with more than one parent per with more than one parent per child. child.

•So, the network model permitted So, the network model permitted the modeling of many-to-many the modeling of many-to-many relationships in datarelationships in data

•The basic data modeling construct The basic data modeling construct in the network model is the set in the network model is the set construct. construct.

•A set consists of an owner record A set consists of an owner record type, a set name, and a member type, a set name, and a member record type. A member record type record type. A member record type can have that role in more than can have that role in more than one setone set

CS424 Introduction of Database System CS424 Introduction of Database System

Advantages of DBMSsAdvantages of DBMSs

Control of data redundancyControl of data redundancy Data consistencyData consistency More information from the same amount of More information from the same amount of

datadata Sharing of dataSharing of data Improved data integrityImproved data integrity Improved securityImproved security Enforcement of standardsEnforcement of standards Economy of scaleEconomy of scale

CS424 Introduction of Database System CS424 Introduction of Database System

Advantages of DBMSsAdvantages of DBMSs

Balance conflicting requirementsBalance conflicting requirements Improved data accessibility and Improved data accessibility and

responsivenessresponsiveness Increased productivityIncreased productivity Improved maintenance through data Improved maintenance through data

independenceindependence Increased concurrencyIncreased concurrency Improved backup and recovery servicesImproved backup and recovery services

CS424 Introduction of Database System CS424 Introduction of Database System

Disadvantages of DBMSsDisadvantages of DBMSs

ComplexityComplexity SizeSize Cost of DBMSCost of DBMS Additional hardware costsAdditional hardware costs Cost of conversionCost of conversion PerformancePerformance Higher impact of a failureHigher impact of a failure