Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management...

14
Database Management Systems

Transcript of Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management...

Page 1: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

Database Management Systems

Page 2: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

Unit 1 (2010-2011) © Aditya Engineering College

• Database Management System (DBMS) contains information about a particular enterprise– Collection of interrelated data– Set of programs to access the data – An environment that is both convenient and efficient to use

• 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

• Databases touch all aspects of our lives

Database System Applications

Page 3: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

Unit 1 (2010-2011) © Aditya Engineering College

DBMS Is Every Where

Page 4: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

Unit 1 (2010-2011) © Aditya Engineering College

Steps in tranforming Data into Information

1. Acquisition: Acquiring data from the environment. This data acquired will be in an unorganized form.

2. Storage: It is at this level the data starts transforming into information and stored on a medium.

3. Manipulation: The stored information is manipulated according to the requirements.

4. Retrieval: The information is retrieved from the storage medium.

5. Distribution: The retrieved information is distributed/presented to the users.

Data: Facts concerning things such as people, object, events etc. e.g. students, the courses they are taking and their grades etc.

Information: Data that have been processed and presented in a form suitable for human interpretation, often with the purpose of revealing

trends or patterns e.g. percentage enrollment in various courses, enrollment projections, top rankers etc.

Data and Information

Page 5: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

Unit 1 (2010-2011) © Aditya Engineering College

Drawbacks of File System

Data redundancy and inconsistency - Multiple file formats, duplication of information in different files.

Difficulty in accessing data - Need to write a new program to carry out each new task

Data isolation - multiple files and formats

Integrity problems - Integrity constraints (e.g. account balance > 0) become “buried” in program code rather than being stated explicitly; Hard to add new constraints or change existing ones

Atomicity of updates - Failures may leave database in an inconsistent state with partial updates carried out; Example: Transfer of funds from one account to another should either complete or not happen at all

Page 6: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

Unit 1 (2010-2011) © Aditya Engineering College

Drawbacks of file systems (Cont.)Concurrent access by multiple users - Concurrent access needed for

performance; Uncontrolled concurrent accesses can lead to inconsistencies. Example: Two people reading a balance and updating it at the same time

Security problems - Hard to provide user access to some, but not all, data

Database systems offer solutions to all the above problemsDB System Applications:Banking, Airlines, Credit Card, Universities / colleges, Telecom, Finance, Sales, Manufacturing, Human Resources

From Indirect usage to direct usage

Internet, on-line access – bank accounts, books, order - everything in life

Big companies – Oracle, Microsoft, IBM

Page 7: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

Unit 1 (2010-2011) © Aditya Engineering College

Database ApproachMany of the mentioned disadvantages are a result of the approach which

concentrates on the system’s processes first (process-driven approach) and treats the data as inputs and outputs to those processes. The database approach instead considers the system’s data first (data-driven approach) and then identifies the processes that interact with the data.

Designers have discovered that a combination of the two approaches is usually the most appropriate. One reason for this is that there are always new processes in organizations that require new data and the structure of such data will be driven by the processes that use it.

DBMS consists of a collection of interrelated data and a set of programs to access those data. The primary goal of a DBMS is to provide an environment that makes it both convenient and efficient to retrieve and store the database information.

Page 8: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

Unit 1 (2010-2011) © Aditya Engineering College

DATA BASE LANGUAGEData Manipulation Language (DML)

Language for accessing and manipulating the data organized by the appropriate data model

DML also known as query language

Two classes of languages

Procedural – user specifies what data is required and how to get those data

Declarative (nonprocedural) – user specifies what data is required without specifying how to get those data

SQL (Structured Query Language) is the most widely used query language

Page 9: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

© Aditya Engineering College

Data Definition Language (DDL)• Specification notation for defining the database schema

Example: create table account ( account_number char(10),

branch_name char(10), balance integer)

• DDL compiler generates a set of tables stored in a data dictionary

• Data dictionary contains metadata (i.e., data about data)– Database schema – Data storage and definition language

• Specifies the storage structure and access methods used– Integrity constraints

• Domain constraints• Referential integrity (e.g. branch_name must correspond

to a valid branch in the branch table)– Authorization

Page 10: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

© Aditya Engineering College

Data Models

A collection of tools for describing - Data , Data relationships, Data semantics and Data constraints

Relational model Entity-Relationship data model (mainly for database design) Object-based data models (Object-oriented and Object-relational) Semi structured data model (XML) Other older models: Network model & Hierarchical model

A data model is a collection of concepts for describing data. A schema is a description of a particular collection of data, using a given data model. The relational model of data is the most widely used model today. Main concept: relation, basically a table with rows and columns.

Every relation has a schema, which describes the columns, or fields.

Page 11: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

© Aditya Engineering College

What Is a DBMS?

• A very large, integrated collection of data.• Models real-world enterprise.

– Entities (e.g., students, courses)– Relationships (e.g., Ravi is taking DBMS)

• A Database Management System (DBMS) is a software package designed to store and manage databases.

Why Use a DBMS? Data independence and efficient access. Reduced application development time. Data integrity and security. Uniform data administration. Concurrent access, recovery from crashes.

Page 12: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

© Aditya Engineering College

Why Study Databases??

• Shift from computation to information• Datasets increasing in diversity and volume.

– Digital libraries, interactive video, Human Genome project, Internet data

– ... need for DBMS exploding• DBMS encompasses most of CS

– OS, languages, theory, AI, multimedia, logic

?

Page 13: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

© Aditya Engineering College

Files vs. DBMS• Application must stage large datasets between main memory

and secondary storage (e.g., buffering, page-oriented access, 32-bit addressing, etc.)

• Special code for different queries• Must protect data from inconsistency due to multiple

concurrent users• Crash recovery• Security and access control

Levels of Abstraction:Physical level: describes how a record (e.g., customer) is stored.Logical level: describes data stored in database, and the relationships among the data.

type customer = recordcustomer_id : string;

customer_name : string;customer_city : string;

end;View level: application programs hide details of data types. Views can also hide information (such as an employee’s salary) for security purposes.

Page 14: Database Management Systems. Unit 1 (2010-2011)© Aditya Engineering College Database Management System (DBMS) contains information about a particular.

© Aditya Engineering College

Summary

DBMS used to maintain, query large data sets. Benefits include recovery from system crashes, concurrent

access, quick application development, data integrity and security.

Levels of abstraction give data independence. A DBMS typically has a layered architecture. DBAs hold responsible jobs and are well-paid! DBMS R&D is one of the broadest, most exciting areas in

CS.