Module 1 Updated Dbms
Module 1 Updated Dbms
Database System Concepts - 6th Edition 1.2 ©Silberschatz, Korth and Sudarshan
What is Database?
A database is a collection of data, typically describing the activities of one or
more related data.
Database System Concepts - 6th Edition 1.3 ©Silberschatz, Korth and Sudarshan
What is DBMS?
Database System Concepts - 6th Edition 1.4 ©Silberschatz, Korth and Sudarshan
Advantages of
DBMS
Some advantage of DBMS are
•Redundancy can be reduced
•Inconsistency can be avoided
•The data can be shared
•Standards can be enforced
•Security can be enforced
•Integrity can be maintained
Database System Concepts - 6th Edition 1.5 ©Silberschatz, Korth and Sudarshan
Basic
Definitions
• Database: A collection of related data.
• Data: Known facts that can be recorded and have an implicit meaning.
Ex:- MySQL, Microsoft SQL Server, Oracle Database, and Microsoft Access.
Database System Concepts - 6th Edition 1.6 ©Silberschatz, Korth and Sudarshan
Basic
Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
Database System Concepts - 6th Edition 1.7 ©Silberschatz, Korth and Sudarshan
Basic
Definitions
Database System Concepts - 6th Edition 1.8 ©Silberschatz, Korth and Sudarshan
Typical DBMS Terminology
• Anapplication program accesses the database by sending queries
or requests for data to the DBMS.
• A transaction may cause some data to be read and some data to be written
into the database.
Database System Concepts - 6th Edition 1.9 ©Silberschatz, Korth and Sudarshan
A simplified database
environment
1
0
Database System Concepts - 6th Edition 1.10 ©Silberschatz, Korth and Sudarshan
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.
Database System Concepts - 6th Edition 1.11 ©Silberschatz, Korth and Sudarshan
Typical DBMS
Functionality
1) Define a database in terms of data types, structures and constraints
2) Construct or Load the Database on a secondary storage medium
3) Manipulating the database by querying, generating reports,
insertions,
deletions and modifications to its content
4) Concurrent Processing and Sharing by a set of users and programs –
yet, keeping all data valid and consistent
Other features:
– Protection or Security measures to prevent unauthorized access
– “Active” processing to take internal actions on data
– Presentation and Visualization of data
1
2
Database System Concepts - 6th Edition 1.12 ©Silberschatz, Korth and Sudarshan
Database Management System
(DBMS)
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: 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 can be very large.
Databases touch all aspects of our lives
Database System Concepts - 6th Edition 1.13 ©Silberschatz, Korth and Sudarshan
University Database Example
Application program examples
Add new students, instructors, and courses
Register students for courses, and generate
class rosters
Assign grades to students, compute grade
point averages (GPA) and generate transcripts
In the early days, database applications were
built directly on top of file systems
Database System Concepts - 6th Edition 1.14 ©Silberschatz, Korth and Sudarshan
Drawbacks of using file systems to
store data
Database System Concepts - 6th Edition 1.15 ©Silberschatz, Korth and Sudarshan
Drawbacks of using file systems to store data
(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 (say 100) and
updating it by withdrawing money (say 50 each) at the
same time
Security problems
Hard to provide user access to some, but not all, data
Database System Concepts - 6th Edition 1.16 ©Silberschatz, Korth and Sudarshan
Main Characteristics of the Database
Approach
• Self-describing nature of a database system: A DBMS catalog stores the
description of the database. (The description is called meta-data). This
allows the DBMS software to work with different databases.
Database System Concepts - 6th Edition 1.17 ©Silberschatz, Korth and Sudarshan
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.
Database System Concepts - 6th Edition 1.18 ©Silberschatz, Korth and Sudarshan
Types of Databases and
Database Applications
• Big Data Storage Systems or NoSQL databases
• Geographic Information Systems (GIS)
• Data Warehouses and OLAP systems
• Numeric and Textual Databases
• Real-time and Active Databases
• Multimedia Databases
Database System Concepts - 6th Edition 1.19 ©Silberschatz, Korth and Sudarshan
Levels of Abstraction
Physical level: describes how a record (e.g., instructor) is
stored.
Logical level: describes data stored in database, and the
relationships among the data.
type instructor = record
ID : integer;
name : string;
dept_name : string;
salary : integer;
end;
View level: application programs hide details of data
types. Views can also hide information (such as an
employee’s salary) for security purposes.
Database System Concepts - 6th Edition 1.20 ©Silberschatz, Korth and Sudarshan
View of Data
Database System Concepts - 6th Edition 1.21 ©Silberschatz, Korth and Sudarshan
Instances and Schemas
Similar to types and variables in programming languages
Logical Schema – the overall logical structure of the database
Example: The database consists of information about a set of
customers and accounts in a bank and the relationship
between them
Analogous to type information of a variable in a program
Physical schema–
schema the overall physical structure of the database
Instance – the actual content of the database at a particular point
in time
Analogous to the value of a variable
Physical Data Independence – the ability to modify the physical
schema without changing the logical schema
Applications depend on the logical schema
In general, the interfaces between the various levels and
components should be well defined so that changes in some
parts do not seriously influence others.
Database System Concepts - 6th Edition 1.22 ©Silberschatz, Korth and Sudarshan
Database Design
The process of designing the general structure of the
database:
Logical Design – Deciding on the database
schema. Database design requires that we find a
“good” collection of relation schemas.
Business decision – What attributes should we
record in the database?
Computer Science decision – What relation
schemas should we have and how should the
attributes be distributed among the various
relation schemas?
Physical Design – Deciding on the physical layout
of the database
Database System Concepts - 6th Edition 1.23 ©Silberschatz, Korth and Sudarshan
Database Design (Cont.)
Is there any problem with this relation?
Database System Concepts - 6th Edition 1.24 ©Silberschatz, Korth and Sudarshan
Design Approaches
Need to come up with a methodology to ensure that
each of the relations in the database is “good”
Two ways of doing so:
Entity Relationship Model (Chapter 7)
Models an enterprise as a collection of
entities and relationships
Represented diagrammatically by an entity-
relationship diagram:
Normalization Theory (Chapter 8)
Formalize what designs are bad, and test for
them
Database System Concepts - 6th Edition 1.25 ©Silberschatz, Korth and Sudarshan
Database
Users
Users may be divided into
•Actors on the Scene -
Database System Concepts - 6th Edition 1.26 ©Silberschatz, Korth and Sudarshan
Database
Users
Actors on the
scene:
–Database administrators: responsible for authorizing access to the database, for co-ordinating
and monitoring its use, acquiring software, and hardware resources, controlling its use and
monitoring efficiencyof operations.
–Database Designers: responsible to define the the structure, the constraints, and
content, functions or transactions against communicate with the end-users
the database. They must understand their needs. and
–End-users: they use the data for queries, reports and some of them actually update
the
database content.
Database System Concepts - 6th Edition 1.27 ©Silberschatz, Korth and Sudarshan
Workers behind
Scene
Database System Concepts - 6th Edition 1.28 ©Silberschatz, Korth and Sudarshan
■Tool developers design and implement tools—the software packages that
facilitate database modelling and design, database system design, and improved
performance. Tools are optional packages that are often purchased separately.
They include packages for database design, performance monitoring, natural
language or graphical interfaces, prototyping, simulation, and test data
generation. In many cases, independent software vendors develop and market
these tools.
■Operators and maintenance personnel (system administration personnel) are
responsible for the actual running and maintenance of the hardware and software
environment for the database system
Database System Concepts - 6th Edition 1.29 ©Silberschatz, Korth and Sudarshan
Categories of End-
users
• 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.
Example: bank-tellers / reservation clerks who do this activity for an entire shift of
operations.
• 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.
Example: the user of a financial software package that stores a variety of personal
financial data
Database System Concepts - 6th Edition 1.30 ©Silberschatz, Korth and Sudarshan
Database Users and
Administrators
Databas
e
Database System Concepts - 6th Edition 1.31 ©Silberschatz, Korth and Sudarshan
Database System Internals
Database System Concepts - 6th Edition 1.32 ©Silberschatz, Korth and Sudarshan
Database Architecture
Database System Concepts - 6th Edition 1.33 ©Silberschatz, Korth and Sudarshan
History of Database Systems
1950s and early 1960s:
Data processing using magnetic tapes for storage
Tapes provided only sequential access
Punched cards for input
Late 1960s and 1970s:
Hard disks allowed direct access to data
Network and hierarchical data models in widespread
use
Ted Codd defines the relational data model
Would win the ACM Turing Award for this work
IBM Research begins System R prototype
UC Berkeley begins Ingres prototype
High-performance (for the era) transaction
processing
Database System Concepts - 6th Edition 1.34 ©Silberschatz, Korth and Sudarshan
History (cont.)
1980s:
Research relational prototypes evolve into commercial
systems
SQL becomes industrial standard
Parallel and distributed database systems
Object-oriented database systems
1990s:
Large decision support and data-mining applications
Large multi-terabyte data warehouses
Emergence of Web commerce
Early 2000s:
XML and XQuery standards
Automated database administration
Later 2000s:
Giant data storage systems
Google BigTable, Yahoo PNuts, Amazon, ..
Database System Concepts - 6th Edition 1.35 ©Silberschatz, Korth and Sudarshan