Introduction To DBMS
Introduction To DBMS
1
Course Code: KCS 501 Data Base Management System L T P C
3 0 2 4
Why to Study Data Base Management System
Almost every software application relies on a database to store, retrieve, and manage data. This subject directly
contributes to students' employability by imparting skills that are in high demand across industries. A DBMS
allows organizations to enforce data security and privacy policies to reduce the risk of a data breach. Here are
some DBMS use cases in different industries: Economics and finance firms store information about customer
transactions, stock market trades, bonds, mortgages, and other financial products. Here are the following areas
where it is highly demanding.
Telecommunications companies store information about customer calls, billing, archives, and plan features
and capabilities.
Airlines store information about flight schedules, employee work histories, safety records, reservations, and
maintenance.
Educational institutions store information about class schedules, student records, teacher reviews and
remuneration, and class registration.
Sales and marketing organizations store information about customer meetings and sales, returns, feedback,
and prospects.
Human resources firms store information about new and prospective hires, payroll, taxes, employee
performance reviews, and more.
Manufacturers store information about inventory, operations, production blueprints, supply chain, and
maintenance.
2
Evaluation Methodology (Internal Total Marks:50, CTs: 30, TA: 15, Att.: 05)
Evaluation Category (A) :[15 Marks] Evaluation Category (C): [15 Marks]
Two Analytical and applied based Minimum two Coursera/ Udemy /LinkedIn/other
Assignments [ 5 Marks] course certificates as prescribed by subject teachers
[ 5 * 2 Marks = 10 Marks]
3
MOOC Courses
1. https://www.udemy.com/course/relational-database-management-systemrdbms-complete-pack/
2. https://www.udemy.com/course/simplified-approach-to-dbms/
3. https://www.udemy.com/course/database-and-sql-for-beginners/
4. https://www.udemy.com/course/sql-made-easy-for-beginners/
5. https://www.udemy.com/course/learn-sql-beginner-to-advance-level/
6. https://www.udemy.com/course/database-design-from-a-z-with-real-project-arabic-course/
7. https://www.udemy.com/course/learn-complete-database-design-with-mysql-database-project/
8. https://learn.365datascience.com/courses/sql/welcome-to-sql/
9. https://www.linkedin.com/learning/database-foundations-intro-to-databases/an-introduction-to-database-foundati
ons?u=236312842
10. https://www.linkedin.com/learning/paths/become-a-database-administrator?u=236312842 4
5
Bloom’s Knowledge
Course Outcome (CO) Knowledge Level Category
(KL) (KC)
6
Introduction to DBMS
7
Traditional Method of Data Storage
8
• In the traditional approach, we used to store information in flat files
which are maintained by the file system under the operating system’s
control.
• Application programs go through the file system to access these flat
files
9
Ways of storing data in files –
customer data
10
File System Cont.
• Data used to be stored in the form of records in the files.
• Records consist of various fields which are delimited by a space ,
comma , tab etc.
• There used to be special characters to mark end of records and
end of files.
11
1. Master file
The file that is created only once i.e. at the starting of computerization
or a file which rarely changes. For example: In a bank master file the
account no, name and balance are entered only once and less
frequently changes.
2. File activity ratio
The number of records processed one run divided by total number of
records. For example: if we changes 100 records from a bank file
containing 200 records then file activity ratio is 100/200 0.5. It should
be noted that this ratio of master file is less.
3. Transaction file
A file that is created repeatedly after regular interval of time. For
example: the payroll file of employee is updated at the end of every
month. 12
4. Work file
A temporary file that helps in sorting and merging of records from one
file to other.
13
LIMITATIONS OF FILE ORIENTED
APPROACH
1. Duplicate data / Data Redundancy
Since all the files are independent of each other. So some of the fields
or files are stored more than once. Hence duplicacy is more in case of
file approach. This duplication of data (redundancy) leads to higher
storage and access cost. In addition it may lead to data inconsistency
14
2. Data Inconsistency
In this system, data is not consistent. If a data item is changed then all the
files containing that data item need to be changed and updated properly. If all
the files are not updated properly there may be high risk of inconsistency.
For Example, assume the same data is repeated in two or more files. If
change is made to data in one file, it is required that the change be made to
the data in the other file as well. If this is not done, it will lead to error during
access to the data.
16
4. Poor data security
All the files are stored in the flat form or text files. These files can
be easily located and trapped because file approach, has no data
security.
The data as maintained in the flat file(s) is easily accessible and
therefore not secure
17
5. Program / Data Dependence
Users and application programs need to know exactly where or how
the data is stored in order to access it. In file processing system the
physical formats of the files are entered in the programs. The
change in file means change in program and vice versa.
18
7. Concurrency problem
It means using a same record at same time by more than one user
at the same time. This problem was common in file approach but
can be controlled in DBMS.
19
Basic Definitions - DBMS
• Data ?
20
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
21
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase?
22
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase: A collection of related data. (Databases are used for storing,
maintaining and accessing any sort of data. They collect information on
people, places or things. That information is gathered in one place so
that it can be observed and analyzed.)
23
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase: A collection of related data. (Databases are used for storing,
maintaining and accessing any sort of data. They collect information on
people, places or things. That information is gathered in one place so
that it can be observed and analyzed.)
• DataBase Management System(DBMS)?
24
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase: A collection of related data. (Databases are used for storing,
maintaining and accessing any sort of data. They collect information on
people, places or things. That information is gathered in one place so
that it can be observed and analyzed.)
• DataBase Management System(DBMS): A software package/ system
to facilitate the creation and maintenance of a computerized database.
25
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase: A collection of related data. (Databases are used for storing,
maintaining and accessing any sort of data. They collect information on
people, places or things. That information is gathered in one place so
that it can be observed and analyzed.)
• DataBase Management System(DBMS): A software package/ system
to facilitate the creation and maintenance of a computerized database.
• DataBase System?
26
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase: A collection of related data. (Databases are used for storing,
maintaining and accessing any sort of data. They collect information on
people, places or things. That information is gathered in one place so
that it can be observed and analyzed.)
• 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.
27
Database Systems
• 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 systems are used to manage collections of data that are:
• Highly valuable
• Relatively large
• Accessed by multiple users and applications, often at the same time.
• A modern database system is a complex software system whose task is to manage a large,
complex collection of data.
• Databases touch all aspects of our lives
28
Database Applications Examples
• Enterprise Information
• Sales: customers, products, purchases
• Accounting: payments, receipts, assets
• Human Resources: Information about employees, salaries, payroll taxes.
• Manufacturing: management of production, inventory, orders, supply chain.
• Banking and finance
• customer information, accounts, loans, and banking transactions.
• Credit card transactions
• Finance: sales and purchases of financial instruments (e.g., stocks and bonds; storing real-
time market data
• Universities: registration, grades
29
Database Applications Examples
(Cont.)
• Airlines: reservations, schedules
• Telecommunication: records of calls, texts, and data usage, generating monthly bills, maintaining
balances on prepaid calling cards
• Web-based services
• Online retailers: order tracking, customized recommendations
• Online advertisements
• Document databases
• Navigation systems: For maintaining the locations of varies places of interest along with the exact
routes of roads, train systems, buses, etc.
30
Purpose of Database Systems
In the early days, database applications were built directly on top of file systems, which leads to:
• Data redundancy and inconsistency: data is stored in multiple file formats resulting in 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
31
Purpose of Database Systems
(Cont.)
• Atomicity problems
• 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 anomalies
• Concurrent access needed for performance
• Uncontrolled concurrent accesses can lead to inconsistencies
• Ex: 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.
33
Typical DBMS Functionality
Other features:
• Protection or Security measures to prevent unauthorized access
• “Active” processing to take internal actions on data
• Presentation and Visualization of data
34
Where does the DBMS fit in?
Now, the DBMS acts as a layer of abstraction on top of the File system.
• You might have observed that, for interacting with the file system, we were using
high level language functions for example, the ‘c’ file handling functions. For
interacting with the DBMS we would be using a Query language called SQL 35
Difference Between File and DBMS Operations
36
Types of Database
37
38
Main Characteristic of Database
• Data Abstraction
• Support of multiple views of the data
• Self-describing nature of a database system
• Insulation between programs and data
• Sharing of data and multiuser transaction processing
39
Main Characteristic of Database
• 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
• Self-describing nature of a database system
• Insulation between programs and data
• Sharing of data and multiuser transaction processing
40
Main Characteristic of Database
• 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.
• Self-describing nature of a database system
• Insulation between programs and data
• Sharing of data and multiuser transaction processing
41
Main Characteristic of Database
• 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.
• 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.
• Insulation between programs and data
• Sharing of data and multiuser transaction processing
42
Main Characteristic of Database
• 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.
• 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.
• Insulation between programs and data: Called program-data
independence. Allows changing data storage structures and operations
without having to change the DBMS access programs.
• Sharing of data and multiuser transaction processing
43
Main Characteristic of Database
• 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.
• 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.
• Insulation between programs and data: Called program-data independence. Allows
changing data storage structures and operations without having to change the DBMS
access programs.
• 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.
44
Three Level Architecture of
DBMS
A major purpose of a database system is to provide users with an abstract view
of the data. That is, the system hides certain details of how the data is stored and
maintained.
• Conceptual Level
45
46
Three Level Architecture of DBMS
Sales Officer Inventory Controller
View 1 View 2 continue…
Item_Name Item_Name
External Price Stock
Level
Conceptual
Item_Number Character (6)
Item_Name Character(30)
Conceptual Price Numeric(5,2)
Level Stock Numeric(4)
Physical
Stored_Item Length=50
Physical Item # Type = Byte(6), offset = 0, Index = Ix
Level Name Type = Byte(30), offset = 6
Price Type = Byte(8), offset = 36
Stock Type = Byte(4), offset = 44
47
External or View Level
This level is closest to the users and is concerned with the way in
which the data is viewed by individual users. Most of the users are
not concerned with all the information contained in the database.
Instead they need only a part of the database relevant to them.
The system provides many views for the same database.
48
External or View Level
continue…
49
Conceptual Level
This level of abstraction describes what data are actually stored in the
database. It also describes the relationships existing among data. At
this level, the database is described logically in terms of simple data-
structures. The users of this level are not concerned with how these
logical data structures will be implemented at the physical level, rather
they just are concerned about what information is to be kept in the
database.
50
Conceptual Level
continue…
• Describes what data are actually stored in the database (i.e. all the
records and relationships included in the database).
51
Internal or Physical Level
• Lowest level of abstraction.
• Internal view – internal schema (not only defines the various types of stored
record but also specifies what indexes exists, how files are represented, etc.)
• The internal level is closest to physical storage. This level is also termed as
physical level. It describes how the data are actually stored on the storage
medium. At this level, complex low-level data structures are described in
detail.
52
Data Independence
53
Physical Data Independence
It refers to the ability to modify the schema at the physical level without
affecting the schema followed at the conceptual level.
The application programs remain the same even though the schema at the
physical level gets modified.
54
Logical Data Independence
It refers to the ability to modify the conceptual schema without causing any
changes in the schemas followed at view levels.
The logical data independence ensures that the application programs remain
the same.
55
Physical & Logical Data
Independence
The reason being that the application programs are heavily dependent
on the logical structure of the database.
56
Physical DBMS Architecture
57
DBMS Structure
General users AP Sophisticated DBA
users
Application System Database
Programs Calls Schema
Database
Manager
File
Manager
Database
DDL – set of commands required to Manager the
define format of data.
DML – set of commands that modify, process data.
File
DML precompiler converts DML statements embedded in an
Manager
application program to normal procedural calls in the host
language. It interacts with the query processor in order to
generate the appropriate code. Data Files Data Dict.
59
DBMS Structure
General users Query DBA
Application Database
Programs Schema
Database
Manager
Database
Manager
File
Manager
Database
Manager
Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager
Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Checks that the user has necessary authorization to carry
Manager
out the required function.
Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager
Converts commands to a logical sequence of steps.
Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Checks the requested operation satisfies all necessary
Manager
integrity constraints such as key constraints.
Components
Application System Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Examines the query language statements and tries to
Buffer Manager File
choose the best and most efficient way to executing the
Manager
query. Factors – CPU time, disk time, network time,
sorting methods and scanning methods.
Data Files Data Dict.
68
DBMS Structure
General users AP Query DBA
Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager
The transaction manager maintains tables of
authorization concurrency.
Data Files Data Dict.
69
DBMS Structure
General users AP Query DBA
Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager
It controls the relative order in which transaction
operations are executed.
Data Files Data Dict.
70
DBMS Structure
General users AP Query DBA
Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager
Ensures that the database remains in a consistent state in
the presence of failures. Responsible for transaction
commit and abort.
Data Files Data Dict.
71
DBMS Structure
General users AP Query DBA
Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Responsible for the transfer of data between main
Transaction Manager
• memory and secondary storage. Database
Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager
73
Database Users
3. End Users – Are the people who uses the database for
querying, updating, and generating reports. Different
categories of end users are –
• Casual End Users – Occasionally access the database, but they
may need different information each time.
• Naïve or Parametric End User - Their main job function revolves
around constantly querying and updating the database, using
standard types of queries and updates – called canned
transactions. Ex – Bank tellers check account balances and post
withdrawals and deposits. Reservation clerk checks for
availability and make reservations.
• Sophisticated End Users - Includes scientists, engineers who
thoroughly familiarize themselves with the facilities of DBMS in
order to implement their applications to meet their complex
requirements.
• Standalone Users – Maintain personal database by using ready
made program packages that provide easy to use menu based or
graphics based interfaces.
Database Users
Slide 1-80
Additional Implications of Using the
Database Approach
• Potential for enforcing standards: this is very
crucial for the success of database applications
in large organizations Standards refer to data
item names, display formats, screens, report
structures, meta-data (description of data) etc.
• Reduced application development time:
incremental time to add each new application
is reduced in comparison of file system.
Slide 1-81
Additional Implications of Using the
Database Approach
• Flexibility to change data structures:
database structure may evolve as new
requirements are defined.
• Availability of up-to-date information – very
important for on-line transaction systems
such as airline, hotel, car reservations.
• Economies of scale: by consolidating data
and applications across departments wasteful
overlap of resources and personnel can be
avoided.
Slide 1-82
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.
Slide 1-83
When not to use a DBMS
• When no DBMS may suffice:
• If the database system is not able to handle the complexity of data because of
modeling limitations
• If the database users need special operations not supported by the DBMS.
Slide 1-84
Data Models
• Data Model: A collection of tools for describing
• Data
• Data relationships
• Data semantics
• Data constraints
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.
98