Unit I_Database Management System
Unit I_Database Management System
System
• Data
• Data is the raw material that can be processed for any computing machine.
For example − Employee name, Product name, Name of the student, Marks of the student, Mobile
number, Image etc.
• Information
• Information is the data that has been converted into more useful or intelligent form.
• Knowledge
• The human mind purposefully organizes the information and evaluates it to produce knowledge.
• A student secures 450 marks. Here 450 is data, marks of the student is the information and hard work required to
get the marks is knowledge.
Data Information
• 1. Bits (characters)
• 2. Fields
• 3. Records
• 4. Files
• 5. Databases
• Bit (Character) - a bit is the smallest unit of data representation (value of a bit may be a 0
or 1). Eight bits make a byte which can represent a character or a special symbol in a
character code.
• File - a group of related records. Files are frequently classified by the application for which
they are primarily used (employee file).
• Reference data types : – Used to store the information about another datatype. It can
be referred as pointers in C.
• LOB data types : – Used to store large objects like images, videos etc
• Unknown Column types : – when column types are not known, this datatype is used.
• User Define data types : – These datatypes are defined by the developer while coding
using the above base datatypes.
Scalar data types
• Character Data type: –This type of datatype is used to store alpha-numeric
values like alphabets as well as numbers and special characters.
• Example:
• CREATE TABLE STUDENT (STD_NAME CHAR (15), ADDRESS VARCHAR2 (50));
• Accurate
• A database is pretty accurate as it has all sorts of build in constraints, checks etc.
e.g. UNIQUE constraints, CHECK constraints.
• The file system organizes the files and helps in the retrieval of files when they are required.
• File systems consist of different files which are grouped into directories.
• They contain only one record format and one or more members.
• Hash Function – Hash function is a mapping function that maps all the set of
search keys to actual record address.
• For example
• if we want to generate an address for STUDENT_ID = 104 using mod (5) hash
function, it always results in the same bucket address 4.
• There will not be any changes to the bucket address here.
• A number of data buckets in the memory for this static hashing remain constant
throughout.
• Insertion – When a new record is inserted into the table, The hash function h
generates a bucket address for the new record based on its hash key K.
Backup and It doesn’t provide backup and recovery It provides backup and recovery of data
Recovery of data if it is lost. even if it is lost.
Query There is no efficient query Efficient query processing is there in
processing processing in the file system. DBMS.
User Access Only one user can access data at a Multiple users can access data at a
time. time.
Meaning The user not required to write The user has to write procedures
procedures. for managing databases
Data is distributed in many Due to centralized nature
Sharing files. So, not easy to share sharing is easy
data
• The physical level describes how data is actually stored in the database.
• In the lowest level, this data is stored in the external hard drives in the form of
files and folders.
2)Conceptual Level
• The conceptual level is at a higher level than the physical level.
• It describes how the database appears to the users conceptually and the
relationships between various data tables.
• The conceptual level does not care for how the data in the database is actually
stored.
3)External Level
• This is the highest level in the three level architecture and closest to the user.
• The external level only shows the relevant database content to the users in
the form of views and hides the rest of the data.
• So different users can see the database as a different view as per their
individual requirements.
Database users
• Any person who uses a database and avails benefits from the database is
known as database user in DBMS.
• Database users in DBMS can access the database and retrieve the data from
the database using applications and interfaces provided by the Database
Management System.
• We can always provide security to our database from being accessed by the
unauthorized users.
• Different database users with different login IDs and passwords can only have
unrestricted access to that part of the database
• Database Administrators (DBA)
• Database Designers
• System Analysts
• Application Programmers / Back-End Developers
• Naive Users / Parametric Users
• Sophisticated Users
• Casual Users / Temporary Users
• Database Administrators (DBA)
• Database Administrators (DBA) are the most important type of database users in
DBMS.
• Database Administrators (DBAs) have full control of the database and they are
sometimes known as the super-users of the database.
• In order to access the database, DBAs have to provide login credentials (account ID
• Database Designers
• Database Designers are the users in DBMS who design and create the structure
of the database including triggers, indexes, schemas, entity relationships,
tables, constraints, etc. which complete the database.
• Database Designers are the type of database users in DBMS who are
responsible for implementing the overall design of the database.
• Naïve Users
• Naive users also known as Parametric End users, don't have any knowledge of
DBMS but still frequently use the database applications to get the desired
results.
• With the help of the interface provided by the DBMS applications, Naive
users mostly use the database to fill in or retrieve the information
• For example: Railway ticket booking users in general are naive/parametric end
users as they don't have much knowledge about DBMS and directly use railway
booking application to book their tickets.
• System Analysts
• System Analysts are the type of database users in DBMS who analyze the
requirements of Naive / Parametric End users.
• Analyzing feasibility, economic and technical aspects are some of the major
responsibilities for a system analyst in DBMS.
• They usually check and gather all the necessary information related to the
database, and if needed, they can change or update the final layout of the
database as per requirements
• Application Programmers
• Application Programmers also known as Back-End Developers, are computer
professional users who are responsible for developing the application
programs (C, C++, Java, PHP, Python, etc.)
• They interact with the database using DML (Data Manipulation Language)
queries to store data inside the database and when needed, they can also fetch
the data from it.
• Sophisticated users
• Sophisticated users are the type of database users in DBMS who know DBMS (DDL &
DML commands) and are familiar with the database.
• Sophisticated users can be business analysts, engineers, scientists, system analysts etc.
• These users are also known as SQL programmers as they can interact with the database
directly using SQL queries, query processors.
• Using SQL queries, they can fetch the data from the database. They can also delete,
update or insert new data into the database.
• For example: Data Engineers & Developers who are familiar with the database, directly
access the database using SQL queries rather than writing programming code for
accessing the database again. Hence, they are termed as sophisticated users.
• Casual users
• Casual users also known as temporary users, are the type of database users in
DBMS who frequently or occasionally use the database services.
• Whenever these users try to access the database, they want all the
information sorted in place.
• Casual/Temporary users have little knowledge about DBMS and each time
they try to access the database, they require new information.
• For example: High-level management people are casual users who have little
knowledge about DBMS and hence, they can access the database to either fill
in new information or retrieve existing results.
• Data independence
• Data independence is the ability to modify the schema without affecting the
programs and the application to be rewritten.
• Data is separated from the programs, so that the changes made to the data
will not affect the program execution and the application.
• Using this property, we can change the storage device of the database without
affecting the logical schema.
• The changes in the physical level may include changes using the following −
• A new storage device like magnetic tape, hard disk, etc.
• It presents data in the form that can be accessed by the end users.
• Codd’s Rule of Logical Data Independence says that users should be able to
manipulate the Logical View of data without any information of its physical
storage.
• Software or the computer program is used to manipulate the logical view of
the data.
• It also describes what data is to be stored in the database along with the
relationship.
• Characteristics of DBMS
• 1. Real World Entity
• The Database can store information such as the cost of vegetables, milk, bread,
etc.
• In DBMS (Database Management System), the entities look like real-world
entities.
• For example, if we want to create a student database, we need some entity. Any
student stores their data.
• Characteristics of DBMS
• 2. Self-explaining nature
• In DBMS (Database Management System), the Database contains another
database, and another database also contains metadata.
• For example, in a school database, the total number of rows and the table's
name are examples of metadata.
• Characteristics of DBMS
• 3. Atomicity of Operations (Transactions)
• atomicity means either the operation should be performed or not performed.
i.e., it should complete the operation on 0% or 100%.
• Example
• Ramesh give his ATM card to his sister Archita and tell her to withdraw 5000
from the ATM. At the same time, Ramesh transferred 2000 rupees to his brother
Monu. At the same time, both operations perform successfully.
• Characteristics of DBMS
• 5. Stores Any Kind of Structured Data
• The Database has the ability to store the data in a structured format.
• DBMS has the ability to store any type of data that exists in the real world, and
these data are structured way.
• Characteristics of DBMS
• 6. Ease of Access
• In DBMS, we can search any kind of stored data by applying a simple search
operation query.
• It is so much faster than manual searching.
• Capabilities of good DBMS
• Data Storage
• Data Retrieval
• Data Update
• Data Security
• Data Independence
• Data redundancy
• Data backup
• Data consistency
• Data integration
• Data Integrity
• Here the term integrity means the data should be correct and consistent in
nature.
• Example:
• There is a bank named ABC bank, and ABC bank has its own Database for the
storage of its customer data. If we try to enter the account details of ABC bank
and the account details are not available in the bank, then the Database gives
the incorrect output. However, if a customer changes their address but the new
address is not updated in the Database, it is called data inconsistency.
Data Security
• The Database should be accessible to the users in a limited way.
• The access to make changes to a database by the user should be limited, and
the users must not be given complete access to the entire Database.
• DDL Interpreter: It processes the DDL statements into a set of table containing
meta data (data about data).
• Embedded DML Pre-compiler:
• It processes DML statements embedded in an application program into
procedural calls.
• Query Optimizer:
• It executes the instruction generated by DML Compiler.
• 2. Storage Manager:
• Storage Manager is a program that provides an interface between the data stored in the database and the
queries received.
• It is also known as Database Control System.
• It maintains the consistency and integrity of the database by applying the constraints and executing the DCL
statements.
• It is responsible for updating, storing, deleting, and retrieving data in the database.
• Authorization Manager:
• It ensures role-based access control, i.e,. checks whether the particular person is privileged to perform the
requested operation or not.
• Integrity Manager:
• It checks the integrity constraints when the database is modified.
• Transaction Manager:
• It controls concurrent access by performing the operations in a scheduled way
that it receives the transaction.
• It ensures that the database remains in the consistent state before and after the
execution of a transaction.
• File Manager:
• It manages the file space and the data structure used to represent information in
the database.
• Buffer Manager:
• It is responsible for cache memory and the transfer of data between the
secondary storage and main memory.
• 3. Disk Storage:
• It contains the following components –
• Data Files:
• It stores the data.
• Data Dictionary:
• It contains the information about the structure of any database object.
• It is the repository of information that governs the metadata.
• Indices:
• It provides faster retrieval of data item.