Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lecture 30 - Database

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 26

SDF II(15B11CI211)

EVEN Semester 2021

2nd Semester , First Year


Jaypee Institute Of Information Technology
(JIIT), Noida
1
Topics Covered
• Data vs. Information
• Database and its Application
• Database Management System
• File based system and its Drawback
• Advantages of Database management System
• Types of DBMS
• Relational DBMS
Data vs. Information

• What is data?
– Data can be defined in many ways. Information science defines
data as unprocessed information.
– Eg:-names, telephone numbers etc.

• What is information?
– Information is data that have been organized and communicated
in a coherent and meaningful manner.
– Data is converted into information, and information is converted
into knowledge.
– Knowledge; information evaluated and organized so that it can
be used purposefully.
Database - Definition

• A database is any organized collection of data. Some examples of databases


you may encounter in your daily life are:
‾ a telephone book
‾ T.V. Guide
‾ airline reservation system
‾ Universities
‾ Credit card transactions
‾ files on your computer hard drive

Other Definitions :
1. A database represents some aspects of the real world , sometimes called the
miniworld. Changes to the miniworld are reflected in the data base
2. A database is a logically coherent collection of data with some inherent meaning.
3. A data base is designed , built and populated with data for a specific purpose. It
has an intended group of users and some preconceived applications in which these
users are interested.
Why do we need a database?

• Keep records of our:


– Clients
– Staff
– Volunteers
– To keep a record of activities and interventions
– Keep sales records
– Develop reports
– Perform research
– Longitudinal tracking
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

• A database management system (DBMS) is a set of software


that are used to define, store, manipulate and control the
data in a database.
– define---define data types, structures and constraints.
– store---store data; provide efficient access.
– manipulate---perform retrieval and update operations
using a query language.
– control ---control access to data.
What is the ultimate purpose of a
database management systems?

is to transform

Data Information Knowledge Action

Database System = Database + DBMS


Database Management System
• The database and DBMS are together called database
system

Figure 1: Database Systens[1]


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
File System Databases
In the early days, database applications were built directly on top
of file systems. The programs are written time to time as per the
requirement to manipulate the data within files.
– A program to debit and credit an account
– A program to find the balance of an account
– A program to generate monthly statements

An Example File System


A banking system may have
– files for customers, saving accounts and checking accounts;
– application programs to deposit and withdraw money, to find
balance, etc.
– different files are used for customers, saving and checking
accounts
Database System vs. File Based System

Figure 2: Database System vs. File Based System[2]


Drawbacks of using file systems to store
data
– 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 — changes made by one operation could not become visible to other
concurrent operations.

– 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
File System Databases
• Drawbacks of using file systems (cont.)

– 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
– 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.

Database systems offer solutions to all the above problems


Advantages of using the DBMS Approach
1. Controlling Redundancy

2. Restricting Unauthorized access

3. Proving Persistent storage for Program objects

4. Providing Storage Structures for efficient Query Processing

5. Providing backup and Recovery.

6. Providing multiple user interfaces

7. Representing Complex Relationships among data

8. Enforcing Integrity Constraints

9. Permitting Interfacing and Actions using rules

10. Additional advantages


Advantages of using the DBMS Approach
1. Controlling Redundancy

• Redundancy means storing the same data multiple times.

Problems of redundancy :

1. Leads to Duplication of efforts

2. Wastage of storage space.

3. Inconsistency.

• In the database approach, these redundancy problems can be removed by storing


logical data items in only one place.
Advantages of using the DBMS Approach
2. Restricting Unauthorized Access
• A DBMS allows only authorized users to access the database to provide the security to the
database.
• A DBMS controls type of access operation (retrieve and update).
• A DBMS provides security and authorization subsystem for the DBA to create accounts and
specify account restriction.

3. Providing Persistent Storage for Program Objects.


• An object – oriented DBMS provides persistent storage for program objects and data
structures.
e.g. :
C++ and java objects can be stored permanently so that later they can be read whenever
necessary.
Advantages of using the DBMS Approach

4. Providing Storage for Structures for Efficient Query Processing.

• Since database is typically stored on disk , DBMS uses index files to speed up the

searching process to increase the efficiency of query processing .

• It uses buffering module to maintain the records in the main memory.

• The query of the DBMS is responsible for choosing an processing and optimization

module efficient query execution plan for each query based on the existing storage

structures.
Advantages of using the DBMS Approach
5. Providing Backup and Recovery.

• The back up and recovery subsystem of the DBMS is responsible for recovery.

6. Providing Multiple User Interface. Theses include

1. query languages for users


2. APIs (Application Programming Interface) for application programmers

3. Forms and command codes for parametric users.

4. Menu Driven interfaces for stand-alone programmers


Advantages of using the DBMS Approach
7. Representing complex Relationship among Data.
• A DBMS has the capability to represent a variety of complex relationships
among the data as well as to retrieve and update related data easily and
efficiently.

8. Enforcing Integrity Constraints.


• A DBMS provides capabilities for defining and enforcing Integrity constraints.
• Two types of constraints :

1. Simple type of integrity constraints

e.g : month must be an integer between 1 - 12

2. complex type of integrity constraints

e.g. a section record must be related to course record.


Advantages of using the DBMS Approach
9. Permitting Inferencing and Actions Using Rules :
• Some database systems provide capabilities for defining deduction rules for
inferencing new information from the stored database facts. Such systems are
called deductive database systems.
• Active database systems provide active rules that can automatically initiate
actions when certain events and conditions occur.

10. Additional advantages :


• Potential for enforcing standards
• Reduced Application Development Time
• Flexibility
• Availability of up-to-Date information.
Data Models
• Data Abstraction is provided by a Data Model. It is a collection of tools for
describing following:
– Data
– Data relationships
– Data semantics (study of meaning)
– Data constraints (restrictions/rules)

OR
• A collection of concepts that can be used to describe the structure of database.
• Structure of database means  the data types , relationships and constraints on
the data.
• A data model may also include operations for retrieval and updates on the
database.
• A set of valid user defined operation can also be specified in a Data Model
Data Models - Types
1. Relational model

2. Entity-Relationship data model (mainly for database design)

3. Object-based data models (Object-oriented and Object-


relational)

4. Semi-structured data model (XML)

5. Other older models:


– Network model
– Hierarchical model
Relational Model
• Relational Model was proposed by E.F. Codd to model data in
the form of relations or tables.
• Relational Model represents how data is stored in Relational
Databases.
• A relational database stores data in the form of relations
(tables).
• Consider a relation STUDENT with attributes ROLL_NO, NAME,
ADDRESS, PHONE and AGE shown in Table.
ROLL_NO NAME ADDRESS PHONE AGE

1 RAM DELHI 9455123451 18

2 RAMESH GURGAON 9652431543 18

3 SUJIT ROHTAK 9156253131 20


IMPORTANT TERMINOLOGIES
• Attribute: Attributes are the properties that
define a relation. e.g.; ROLL_NO, NAME
• Tuple: Each row in the relation is known as
tuple. e.g. 1 RAM DELHI 9455123451 18.
Each row in a tuple is a record.
ROLL_NO NAME ADDRESS PHONE AGE

1 RAM DELHI 9455123451 18

2 RAMESH GURGAON 9652431543 18

3 SUJIT ROHTAK 9156253131 20


Reference Books

1. Henry F Korth, Abraham Silberschatz, S. Sudurshan, Database system


concepts, 5th Edition, McGraw-Hill,2006

2. Database Systems: Design, Implementation, and Management, 9 th Edition,


Coronel, Moris and Rob, 2011

3. Ramez Elmasri , Shamkant B. Navathe , Fundamentals of Database Systems,


4th Edition, Pearson Education, 2006.

4. Ramakrishnan, Gehrke, Database Management Systems, Mcgraw-Hill, 3 rd


Edition, Addison-Wesley,2006.

5. Thomas Connolly, Carolyn Begg, Database Systems-A Practical Approach to


design, Implementation and Management, 3rd Edition, Addison-Wesley,2002.

You might also like