Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer...

84
Introduction: Database Concepts Slides by: Ms. Shree Jaswal

Transcript of Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer...

Page 1: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Introduction: Database ConceptsSlides by: Ms. Shree Jaswal

Page 2: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Topics:

• Introduction

• Characteristics of databases

• File system V/s Database system

• Users of a Database system

• Data Models, Schemas, and Instances

• Three-Schema Architecture and Data Independence

• Database Administrator (DBA)

• Role of a DBA

Module 1 Slides by: Shree J. 2

Page 3: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Which Chapter? Which Book?

• Chapter 1: Introduction to Databases, Elmasri and Navathe, “ Fundamentals of Database Systems”, 6th Edition, PEARSON Education

• Chapter 1: Overview of Database Systems, Raghu Ramkrishnan and Johannes Gehrke, “ Database Management Systems”,TMH

• Chapter 1: Introduction, Korth, Slberchatz,Sudarshan, ”Database System Concepts”, 6th Edition, McGraw – Hill

Module 1 Slides by: Shree J. 3

Page 4: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Computer System Structure• Computer system can be divided into four components

• Hardware – provides basic computing resources

• CPU, memory, I/O devices

• Operating system

• Controls and coordinates use of hardware among various applications and users

• Application programs – define the ways in which the system resources are used to solve the computing problems of the users

• Word processors, compilers, web browsers, database systems, video games

• Users

• People, machines, other computers

Module 1 Slides by: Shree J. 4

Page 5: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Layers and Views

Module 1 Slides by: Shree J. 5

Page 6: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

What is an Operating System?

• A program that acts as an intermediary between a user of a computer and the computer hardware.

Operating system goals:

• Execute user programs and make solving user problems easier.

• Make the computer system convenient to use.

• Use the computer hardware in an efficient manner.

Module 1 Slides by: Shree J. 6

Page 7: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

OS as Resource Manager

Module 1 Slides by: Shree J. 7

Page 8: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Files

Module 1 Slides by: Shree J. 8

Page 9: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Files

Module 1 Slides by: Shree J. 9

Page 10: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 10

Introduction to data processing

• Definition from Webopedia

“ Refers to a class of programs that organize and manipulate data, usually large amounts of numeric data. Accounting programs are the prototypical examples of data processing applications. “

• Definition from Wikipedia

“ Computer data processing is any process that uses a computer program to enter data and summarise, analyse or otherwise convert data into usable information. The process may be automated and run on a computer. It involves recording, analysing, sorting, summarising, calculating, disseminating and storing data. “

Page 11: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 11

Overview of Files & File Systems

• One way to keep the information is to store it in operating system files.

• To manipulate such information , system has a no. of application programs.

• New application programs are needed as the need arises.

• Thus, as time goes by, the system acquires more files and more application programs.

• Keeping the organizational information in file processing system has following disadvantages:

Data Redundancy & Inconsistency:

• Multiple file formats

• Duplication of information in different files

• Change in one file may not reflect the change in other file.

Page 12: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 12

Disadvantages of File Processing SystemDifficulty in accessing the data:

• Conventional File processing system do not allow the convenient & efficient way of retrieving the data.

• Need to write a new program to carry out each new task.

Data isolation :

• Data are scattered in various files of different formats, so writing new programs to retrieve the appropriate data is difficult.

Integrity Problems:

• In this system , it is difficult to add new constraints , as it need to change each file program code.

Atomicity Problems:

• Mechanical or electrical failure may leave database in an inconsistent state with partial updates carried out.

• So it is difficult to ensure atomicity in this system.

Page 13: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 13

File Processing System

Disadvantages of File Processing System -cont:

Concurrent Access anomalies:

• For the sake of overall performance of the system and faster response , many systems allow multiple users to update data simultaneously.

• But it is difficult for file system to ensure concurrency as data may be accessed by many different application programs that have not been coordinated previously.

Security Problem:

• Not every user of the database system should be able to access all the data.

• So, for file system it is difficult to enforce such security constraint.

Page 14: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 14

File System Vs. Database System

Database Systems offers solutions to all File system Problems

Controlled Redundancy:

• Storing the data multiple times (Redundancy) avoided through database approach .

• It stores each logical data item in only one place while designing the database.

• This saves storage space, time for multiple updates and ensures consistency.

Restricting the unauthorized access:

• DBMS provides a security & authorization subsystem through which DBS staff grant privileges to another user.

Page 15: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 15

File System Vs. Database System

Providing Storage Structures for efficient Query processing:

• DBMS provides specialized data structures to speed up disk search for desired record.

• It provides facility of Indexes which are typically based on tree or hash data structures.

Providing Back –up & Recovery:

• By introducing save point , it gives the back up& recovering facility.

Providing Multiple user interfaces:

• Casual Users - Query Language interface

• Application Programmer - Programming language interface

• Naïve users – Menu-Driven interfaces

Page 16: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 16

File System Vs. Database SystemAdvantages of Database system

Representing Complex Relationships among data:

• With the help of nested queries and Join concept, DBMS has capacity to represent complex relationships among the data.

Enforcing the integrity constraints:

• While designing the database , designer defines the integrity constraints.

Page 17: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 17

Overview of file systemsCase Study

A company has a large collection (say 500 GB) of data on employees, departments, products, sales and so on.

Business constraints:-

1. The data has to be accessed concurrently by several employees.

2. Queries should be answered quickly

3. Changes made to data by different users must be applied consistently

4. Access to certain parts of the data must be restricted.

Page 18: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 18

What can be the problems?

• Is there sufficient main memory for holding all data?

• How do we identify all data items?

• How r we going to retrieve the required data?

• Is the data protected against inconsistent changes?

• How r security policies enforced?

• How the data can be restored to a consistent state after a system crash?

Page 19: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 19

Concept of a database

• Database: A collection of related data.

• Data: Known facts that can be recorded and have an implicit meaning.

• Mini-world: Some part of the real world about which data is stored in a database. For example, student grades and transcripts at a university.

• Database Management System (DBMS): A software package/ system to facilitate the creation and maintenance of a computerized database.

• Database System: The DBMS software together with the data itself. Sometimes, the applications are also included.

Page 20: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 20

DBMS is a general-purpose software System, that facilitates the processes of

Defining, constructing, manipulating,Sharing databases among various users

And applications.

Page 21: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 21

When not to use a DBMS• Main inhibitors (costs) of using a DBMS:

• High initial investment and possible need for additional hardware.

• Overhead for providing generality, security, concurrency control, recovery, and integrity functions.

• When a DBMS may be unnecessary:

• If the database and applications are simple, well defined, and not expected to change.

• If there are stringent real-time requirements that may not be met because of DBMS overhead.

• If access to data by multiple users is not required.

Page 22: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 24

• DBMS contains information about a particular enterprise

• Collection of interrelated data

• Set of programs to access the data

• Database Applications:

• Banking: all transactions

• Airlines: reservations, schedules

• Universities: registration, grades

• Sales: customers, products, purchases

• Online retailers: order tracking, customized recommendations

• Manufacturing: production, inventory, orders, supply chain

• Human resources: employee records, salaries, tax deductions

Database Management System (DBMS)

Page 23: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 25

Typical DBMS Functionality

• Define a database : in terms of data types, structures and constraints

• Construct or Load the Database on a secondary storage medium

• Manipulating the database : querying, generating reports, insertions, deletions and modifications to its content

• Concurrent Processing and Sharing by a set of users and programs – yet, keeping all data valid and consistent

• Protection or Security measures to prevent unauthorized access

• Presentation and Visualization of data

Page 24: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 26

Main Characteristics of the Database Approach

• Self-describing nature of a database system: A DBMS catalogstores the description of the database. The description is called meta-data). This allows the DBMS software to work with different databases.

• Insulation between programs and data: Called program-data independence. Allows changing data storage structures and operations without having to change the DBMS access programs.

Page 25: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Self describing nature

Module 1 Slides by: Shree J. 27

Page 26: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 28

Main Characteristics of the Database Approach

• Data Abstraction: A data model is used to hide storage details and present the users with a conceptual view of the database.

• Support of multiple views of the data: Each user may see a different view of the database, which describes only the data of interest to that user.

Page 27: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Example

Module 1 Slides by: Shree J. 29

Page 28: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Views

Module 1 Slides by: Shree J. 30

Page 29: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 31

Main Characteristics of the Database Approach

• Sharing of data and multiuser transaction processing : allowing a set of concurrent users to retrieve and to update the database. Concurrency control within the DBMS guarantees that each transaction is correctly executed or completely aborted. OLTP (Online Transaction Processing) is a major part of database applications.

Page 30: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Database Users

• Users may be divided into those who actually use and control the content (called “Actors on the Scene”) and those who enable the database to be developed and the DBMS software to be designed and implemented (called “Workers Behind the Scene”).

Module 1 Slides by: Shree J. 32

Page 31: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Users of database systems

Actors on the Scene

• Database administrators (DBA) are responsible for:

• Authorizing access to the database

• Coordinating and monitoring its use

• Acquiring software and hardware resources

• Database designers are responsible for:

• Identifying the data to be stored

• Choosing appropriate structures to represent and store this data

Module 1 Slides by: Shree J. 33

Page 32: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Users of database systems

• End users

• People whose jobs require access to the database

• Types

• Casual : access database occasionally when needed

• Naïve or Parametric : they make up a large section of the end-user population. They use previously well-defined functions in the form of “canned transactions” against the database. Examples are bank-tellers or reservation clerks who do this activity for an entire shift of operations.

Module 1 Slides by: Shree J. 34

Page 33: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Users of database systems

End users types cont’d…

• Sophisticated : these include business analysts, scientists, engineers, others thoroughly familiar with the system capabilities. Many use tools in the form of software packages that work closely with the stored database.

• Stand-alone : mostly maintain personal databases using ready-to-use packaged applications. An example is a tax program user that creates his or her own internal database.

Module 1 Slides by: Shree J. 35

Page 34: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Users of database systems

• System analysts

• Determine requirements(specifications) of end users

• Application programmers

• Implement these specifications as programs

Module 1 Slides by: Shree J. 36

Page 35: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Workers behind the Scene

• DBMS system designers and implementers

• Design and implement the DBMS modules and interfaces as a software package

• Tool developers

• Design and implement tools

• Operators and maintenance personnel

• Responsible for running and maintenance of hardware and software environment for database system

Module 1 Slides by: Shree J. 37

Page 36: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

A Brief History of Database Applications

• Early database applications using hierarchical and network systems

• Large numbers of records of similar structure

• Providing data abstraction and application flexibility with relational databases

• Separates physical storage of data from its conceptual representation

• Provides a mathematical foundation for data representation and querying

Module 1 Slides by: Shree J. 38

Page 37: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Hierarchical model and network model

Module 1 Slides by: Shree J. 39

Page 38: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Relational model

Module 1 Slides by: Shree J. 40

Page 39: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

A Brief History of Database Applications (cont'd.)

• Object-oriented applications and the need for more complex databases

• Used in specialized applications: engineering design, multimedia publishing, and manufacturing systems

• Interchanging data on the Web for e-commerce using XML

• Extended markup language (XML) primary standard for interchanging data among various types of databases and Web pages

Module 1 Slides by: Shree J. 41

Page 40: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Object Oriented model

Module 1 Slides by: Shree J. 42

Page 41: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

XML

Module 1 Slides by: Shree J. 43

Page 42: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Differences between OODB and RDB

Module 1 Slides by: Shree J. 44

Page 43: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

A Brief History of Database Applications (cont'd.)

• Extending database capabilities for new applications

• Extensions to better support specialized requirements for applications

• Enterprise resource planning (ERP)

• Customer relationship management (CRM)

• Databases versus information retrieval

• Information retrieval (IR)

• Deals with books, manuscripts, and various forms of library-based articles

Module 1 Slides by: Shree J. 45

Page 44: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 46

Data Models, Schemas, instances

• Categories of Data Models

• Schemas, Instances and Database State

Page 45: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 47

Data Models

• Data Model: A set of concepts to describe the structure of a database, and datatypes, relationships, and constraints that should hold for the data.

• Data Model Operations: Operations for specifying database retrievals and updates by referring to the concepts of the data model. Operations on the data model may include basic operations and user-defined operations.

Page 46: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 48

Categories of data models

• Conceptual (high-level, semantic) data models: Provide concepts that are close to the way many users perceive data. (Also called entity-based or object-based data models.)

• Physical (low-level, internal) data models: Provide concepts that describe details of how data is stored in the computer.

• Implementation (representational) data models: Provide concepts that fall between the above two, balancing user views with some computer storage details.

Page 47: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 49

Schemas, Instances, and Database State

• The overall design of the database, description of database is called Database Schema. (Intension)

• Each object in the schema is called Schema Construct

• Database change over time as information is inserted or deleted.

• The collection of the information stored in the database at a particular moment is called an Instance of the database, database state, snapshot (Extension)

• DBMS Catalog stores the descriptions of the schema constructs and constraints-also called as meta-data

• Occasional changes made to the schema is called as schema evolution.

Page 48: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 50

Schema diagram of employees working in a company

Page 49: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 51

Abstraction

• Abstraction is the process or result of generalization by reducing the information content of a concept or an observable phenomenon, typically to retain only information which is relevant for a particular purpose.

Page 50: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 52

Data Abstraction

Need of Data Abstraction

• A major purpose of a database system is to provide user with an abstract view of the data.

• Since many DBS users r not computer trained, developer hides the complexity from users through several levels of abstraction, to simplify the user interaction with the system.

• The system hides the details of how the data is stored and maintained.

Page 51: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 53

Three-schema Architecture• Internal level (internal schema) which describes the physical

structure of the database

• Conceptual level (Conceptual Schema) which describes the structure of the whole database (entities, data types, relationships, user operations, constraints)

• External or View level (External schemas or User Views –Displays to the user group his topic of interest only

Page 52: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 54

Three-schema Architecture

Page 53: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 56

Data Independence

• Data Independence:

• The ability to modify a schema definition in one level without affecting a schema definition in the next higher level .

• Physical Data Independence:

• It is the ability to modify the physical schema without causing application programs to be rewritten.

• Modifications at the physical level are occasionally necessary to improve performance.

• Logical Data Independence:

• It is ability to modify the logical schema without causing application programs to be rewritten.

• Modifications at the Logical level are necessary whenever the logical structure of the database is altered.

Page 54: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 57

Data Abstraction Levels

• Physical Level (Internal Level):

• The Lowest level of abstraction describes how data are actually stored.

• At physical level , complex low level data structures are described in detail.

• Logical Level or conceptual level:

• The next-higher level of abstraction describes what data are stored in the database, and what relationships exists among the data.

• Hides the details of physical storage structures and concentrates on describing entities, data types, relationships, user operations and constraints.

• View Level:

• The highest level of abstraction describes only part of the database.

• Many users of the database do not need all the info in DB , instead they need to access only a part of the database.

• Concept of Views is used.

Page 55: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 58

External View in C language

Struct Student {

Char stud_name(10);

Int matriculation_number(6);

Char sex(1);

Conceptual View

STUDENT

STUD_NAME CHARACTER(10);

MATRICULATION_NUMBER INT(6);

SEX CHARACTER(1);

Internal view

STORED_STUDENT BYTES=20

PREFIX BYTES=6,OFFSET=0

MATRICULATION# BYTES=6,OFFSET=6,INDEX=MATRIC#

STUDNAME BYTES=4,OFFSET=12

SEX BYTES=1, OFFSET=16

Page 56: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 59

DBMS Languages and Interfaces

• Data Definition Language (DDL): Used by the DBA and database designers to specify the conceptual schema of a database. In many DBMSs, the DDL is also used to define internal and external schemas (views). In some DBMSs, separate storage definition language (SDL) and view definition language(VDL) are used to define internal and external schemas.

• In RDBMS, SQL is used in the role of VDL.

Page 57: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 60

DBMS Languages

• Data Manipulation Language (DML): Used to specify database retrievals and updates.

• DML commands (data sublanguage) can be embedded in a general-purpose programming language (host language), such as COBOL, C or an Assembly Language.

• Alternatively, stand-alone DML commands can be applied directly (query language).

Page 58: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 61

DBMS Languages• DML is of two types:-

• High Level or Non-procedural Languages: e.g., SQL, are set-oriented and specify what data to retrieve than how to retrieve. Also called declarative languages.

• Low Level or Procedural Languages: record-at-a-time; they specify how to retrieve data and include constructs such as looping.

• A query in a high-level DML specifies which data to retrieve and called as declarative

• DML commands can be either

• Standalone – Query language

• embedded in host language - data sublanguage

Page 59: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 62

DBMS Interfaces• Stand-alone query language interfaces.

• Programmer interfaces for embedding DML in programming languages:

• Pre-compiler Approach

• Procedure (Subroutine) Call Approach

• User-friendly interfaces:

• Menu-based, popular for browsing on the web

• Forms-based, designed for naïve users

• Graphics-based (Point and Click, Drag and Drop etc.)

• Natural language: requests written in English

• Combinations of the above

Page 60: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 63

Architectures for DBMSs

• Centralized

• Client/server

Page 61: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 64

Centralized DBMS Architecture

Page 62: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 65

Centralized DBMS

• Centralized DBMS: combines everything into single system including- DBMS software, hardware, application programs and user interface processing software.

Page 63: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 66

A Physical Centralized Architecture

Page 64: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 67

Client Server architecture

• Specialized Servers with Specialized functions

• File server, printer server, web servers e-mail servers

• Clients - interfaces to utilize these servers, local processing

• Server – hardware, software and provide services like file access, printing, archiving, database access.

Page 65: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 68

Logical two-tier Client/Server Architecture

Client Client Client

PrintServer

FileServer

DBMSServer

Page 66: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 69

Physical two-tier client/server architecture

Communication Network

Diskless Client

Client

Site1

Client with Disk

Site2

Client

Server

Site3

Server Server and Client

Server

Client

Site n

Page 67: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 70

Clients

• Provide appropriate interfaces and a client-version of the system to access and utilize the server resources.

• Clients maybe diskless machines or PCs or Workstations with disks with only the client software installed.

• Connected to the servers via some form of a network.(LAN: local area network, wireless network, etc.)

Page 68: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 71

DBMS Server

• Provides database query and transaction services to the clients

• Sometimes called query and transaction servers

Page 69: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 72

Two-tier architecture

Advantages:- Simplicity, compatibility

Page 70: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 73

Two Tier Client-Server Architecture

• User Interface Programs and Application Programs run on the client side

• Interface called ODBC (Open Database Connectivity) provides an Application program interface (API) allow client side programs to call the DBMS. Most DBMS vendors provide ODBC drivers.

Page 71: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 74

Two Tier Client-Server Architecture

• A client program may connect to several DBMS.

• Other variations of clients are possible: e.g., in some DBMS, more functionality is transferred to clients including data dictionary functions, optimization and recovery across multiple servers, etc. In such situations the server may be called the Data Server.

Page 72: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 75

Three-tier client-server architecture

Page 73: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 76

Three-tier Architecture

• Common for Web applications

• Intermediate Layer called Application Server or Web Server:

• stores the web connectivity software and the rules and business logic (constraints) part of the application used to access the right amount of data from the database server

• acts like a conduit for sending partially processed data between the database server and the client.

• Additional Features- Security:

• encrypt the data at the server before transmission

• decrypt data at the client

Page 74: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 77

Transaction ManagementACID Properties

• A Transaction is a collection of operations that performs a single logical function in a database application.

• Several operations on the database form a single logical unit of work.

• To ensure integrity of the data , the database system maintains the following properties of transaction:

• Atomicity: Either all operations of the transaction are reflected properly or none are.

• Consistency : execution of a transaction in isolation (i.e. no other transaction executing concurrently) preserves the consistency of the database.

• Isolation: Even though multiple transactions execute concurrently, each transaction is unaware of other transactions executing concurrently in the system.

• Durability: After a transaction completes successfully, the changes it has made to the database persist, even if there are system failures.

Page 75: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 78

Overall System Structure

S

Y

S

T

E

M

S

T

R

U

C

T

U

R

E

Page 76: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 79

Overall System Structure

• The design of Database System must include the considerations of the interface between the database system and the operating system.

• Functional Components of a database system are:

• Query Processor Components

• DML compiler: Translates DML statements into low level instructions that query evaluation engine can understand.

• Embedded DML precompiler: Converts DML statements embedded in an application program to normal procedure calls in the host language.

• DDL interpreter : interprets DDL statements and records them in a set of tables containing metadata.

• Query Evaluation Engine: Executes low-level instructions generated by DML compiler

Page 77: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 80

Overall System Structure

• Storage Manger Components

• Authorization & Integrity Manager: Test satisfaction of integrity constraints and checks authority of users to access data.

• Transaction Manager: Ensures that the database remains in a consistent state despite the system failures, and concurrent transaction execution without confliction.

• File Manager: Manages the allocation of space on disk storage and data structures used to represent information.

• Buffer Manager: Responsible for fetching data from disk storage into main memory and decide what data to cache in memory.

Page 78: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 81

Storage Management

• A storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and the queries submitted to the system.

• A storage manager is responsible for the interaction with the file manager.

• The storage manager translates the various DML statements into low –level file system commands.

• Thus storage manager is responsible for storing, retrieving, and updating data in the database.

Page 79: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 82

Overall System Structure

• In addition , several data structures are required as part of physical system implementation

• Data Files : which stores the database itself

• Data Dictionary : which stores metadata about the structure of the database.

• Indices : which provide fast access to data items that hold particular values.

• Statistical Data: which stores statistical information about the data in the database.

• This info is used by query processor to select efficient ways to execute a query.

Page 80: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 83

Overall System Structure

Page 81: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 84

Database Administrator (DBA)

The person who has the central control of both the data and the programs that access those data is called Database Administrator.

The functions of the DBA are:

• Schema Definition: By writing DDL commands , a set of tables i.e. design of database get stored in a data dictionary.

• Storage structure and access method definition: By writing a set of definitions DBA provides appropriate storage structures and access methods, which is translated by the data-storage

manager and data-definition language(DDL) compiler.

• Schema and physical-organization modification

Page 82: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 85

Database Administrator

The functions of the DBA are: (cont:)

• Granting authorization for data access: Users can be granted permission to access only certain views and relations

• Integrity Constraint Specification:

• The data values stored in the database must satisfy certain consistency constraints.

• The integrity constraints are kept in a special system structure that is consulted by the database system whenever an update takes place in the system.

Page 83: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 86

Crossword

Page 84: Introduction: Database Conceptsssjaswal.com/wp-content/uploads/2017/07/DBMS-module1.pdf · Computer System Structure • Computer system can be divided into four components • Hardware

Module 1 Slides by: Shree J. 87

Activity