DBMS Intro
DBMS Intro
DBMS Intro
Introduction
1. Develop
a database schema that incorporates
keys and integrity constraints
2. FormulateSQL queries to retrieve information from
a relational database
3. Designa relational schema using the entity
relationship model
4. Apply normalization to relations
Course Outcomes
Be
able to create databases and pose complex
SQL queries of relational databases.
Developan appreciation for several DBMS's
(ACCESS, ORACLE and SQL Server)
Familiarize
with a broad range of data
management issues including data integrity and
security
Major Topics
Theory 75%
10 % Quizzes
10% Assignments
30% Mid Semester Exam
50% End Semester Exam
Labs 25 %
70% Lab Tasks
30% Project
Class Etiquettes
Data
6’ 2”
Jane
Fall of Wickets: Sam
Male
4 8 15 16 23 42 Will
5’ 10”
OHT Marks?
Definitions - Information
Information
Processed form of data.
Data can be processed in two ways
Structure and additional data
Data Models
A conceptual view of the database which captures the
nature of data and relations among data.
Entities
A person, place, object, event or concept in the
user/business environment for which information must be
recorded
Relationships
How different entities are interacting with one another
Data Model
Customer Order
Databases in the Real-World
Without a DBMS, your application must rely on files to store its data
persistently. A file-based system is a set of applications that use files to store
their data.
Each application in a file-based system contains its own code for accessing
and manipulating files. This causes several problems:
Code duplication of file access routines
Data is usually highly redundant across files
High maintenance costs
Hard to support multi-user access to information
Difficult to connect information present in different files
Difficulty in developing new applications/handling data changes
Traditional File Processing Systems
Disadvantages of File Processing
Program-Data Dependence
All programs maintain metadata for each file they use
Duplication of data
Different systems/programs have separate copies of the same data
Limited Data Sharing
No centralized control of data
Lengthy Development Times
Programmers must design their own file formats
Excessive Program Maintenance
80% of information systems budget
Problems with Program-Data Dependency
It
is the tight relationship between data stored in files
and the specific programs required to update and
maintain those files
Change in the file format affects both the program
and the file
Lack of coordination and central control
Non-standard file formats
Problems with Data Duplication
Application
#1
Application
#2
DBMS Database
containing
centralized
shared data
Application
DBMS manages data
#3 resources like an operating
system manages hardware
resources
Advantages of Database Approach
Program-Data Independence
Metadata stored in DBMS, so applications don’t need
to worry about data formats
Data queries/updates managed by DBMS so programs
don’t need to process data access routines
Increased application development and maintenance
productivity
Minimal Data Redundancy
Leads to increased data integrity/consistency
Advantages of Database Approach
Up-front costs:
Installation Management Cost and Complexity
Conversion Costs
Ongoing Costs
Requires New, Specialized Personnel
Need for Explicit Backup and Recovery
Organizational Conflict
Old habits die hard
38
Data Definition Language (DDL)
Once a database has been created using DDL, the user accesses data using a Data
Manipulation Language (DML)
The standard DML is SQL.
The DML allows for the insertion, modification, retrieval, and deletion of data.
A DML provides data abstraction as user queries are specified using the names of data
and not their physical representation.
For example, in a file system storing 3 fields, you would have to provide the exact location of the
field in the file. In a database, you would only have to specify it by name.
The DBMS contains all the code for accessing the data, so the applications do not have to worry
about those details any more.
SQL Examples
Question: True or False: The data in a database is lost when the power
to the computer is turned off.
A. True
B. false
Database Abstraction Question
A. Objects
B. Classes
C. Inheritance
D. Polymorphism
DDL vs. DML Question
A. DML
B. DDL
C. schemas
D. Java
Components of the DBMS
Parser + Result
Compiler Formatting Query
Processor
Query Optimizer Execution
Planner Engine
Transaction Buffer
Manager Manager Storage
Recovery File
Manager
System Manager
DB Operating
Files System
Database Architecture
Advantages:
Only one copy of DBMS software on dedicated machine.
Increased performance.
Reduced hardware and communication costs.
Easier to maintain consistency and manage concurrency.
Three-Tier Client-Server Architecture
Advantages:
Reduced client administration and cost using thin web clients.
Easy to scale architecture and perform load balancing.
Database Team
Database administrator (DBA) - responsible for installing, maintaining, and configuring the DBMS
software.
Data administrator (DA) - responsible for organizational policies on data creation, security, and
planning.
Database designer - defines and implements a schema for a database and associated
applications.
Logical/Conceptual database designer - interacts with users to determine data requirements, constraints, and
business rules.
Physical database designer - implements the logical design for a data model on a DBMS. Defines indexes, security,
and constraints.