DBMS Unit-1
DBMS Unit-1
Data
A data is a collection of raw information or facts from which a useful information is derive.
What is Database
The database is a collection of inter-related data which is used to retrieve, insert and delete the
data efficiently. It is also used to organize the data in the form of a table, schema, views, and
reports, etc.For example: The college Database organizes the data about the admin, staff,
students and faculty etc. Using the database, you can easily retrieve, insert, and delete the
information.
Database Management System
A database management system (DBMS) is a collection of programs that enables users to create
and maintain a database.
Or
The DBMS is a general-purpose software system that facilitates the processes of defining,
constructing, manipulating, and sharing databases among various users and applications.
⮚ Database management system is software which is used to manage the database. For
example: MySQL, Oracle, etc are a very popular commercial database which is used in
different applications.
⮚ DBMS provides an interface to perform various operations like database creation, storing
data, updating data, retrieving data, creating a table in the database etc.
⮚ It provides protection and security to the database. In the case of multiple users, it also
maintains data consistency.
These are some examples of popular DBMS:
● MySQL
● Oracle
● SQL Server
● IBM DB2
● PostgreSQL
● SQLite
● Dbase
● Amazon Simple DB (cloud based) etc.
In non-database systems each application program has its own private files. In this case, the
duplicated copies of the same data is created in many places. In DBMS, all data of an
organization is integrated into a single database file. The data is recorded in only one place in the
database and it is not duplicated.
Sharing of Data
In DBMS, data can be shared by authorized users of the organization. The database
administrator manages the data and gives rights to users to access the data. Many users can be
authorized to access the same piece of information simultaneously. The remote users can also
share same data. Similarly, the data of same database can be shared between different application
programs.
Data Consistency
By controlling the data redundancy, the data consistency is obtained. If a data item appears only
once, any update to its value has to be performed only once and the updated value is immediately
available to all users. If the DBMS has controlled redundancy, the database system enforces
consistency.
Integration of Data
In Database management system, data in database is stored in tables. A single database contains
multiple tables and relationships can be created between tables (or associated data entities). This
makes easy to retrieve and update data.
Integration Constraints
Integrity constraints or consistency rules can be applied to database so that the correct data can
be entered into database. The constraints may be applied to data item within a single record or
the may be applied to relationships between records.
Data Security
Report Writers
Most of the DBMSs provide the report writer tools used to create reports. The users can create
very easily and quickly. Once a report is created, it can be used may times and it can be modified
very easily. The created reports are also saved along with database and behave like a software
component.
In a computer file-based system, if two users are allowed to access data simultaneously, it is
possible that they will interfere with each other. For example, if both users attempt to perform
update operation on the same record, then one may overwrite the values recorded by the other.
Most database management systems have sub-systems to control the concurrency so that
transactions are always recorded with accuracy.
In a computer file-based system, the user creates the backup of data regularly to protect the
valuable data from damage due to failures to the computer system or application program. It is
very time consuming method, if amount of data is large. Most of the DBMSs provide the 'backup
and recovery' sub-systems that automatically create the backup of data and restore data if
required.
Data Independence
The separation of data structure of database from the application program that uses the data is
called data independence. In DBMS, you can easily change the structure of database without
modifying the application program.
Disadvantages of DBMS
o Cost of Hardware and Software: It requires a high speed of data processor and large
memory size to run DBMS software.
o Size: It occupies a large space of disks and large memory to run them efficiently.
o Complexity: Database system creates additional complexity and requirements.
o Increased Staff Cost: DBMS requires an educated and skilled staff for managing and
maintaining the databases. So, we need to spend a lot of money to get this level of trained
and experienced staff.
o Performance: Performance is another big disadvantage of database systems because the
speed of the database systems for small firms and organizations is very slow. Hence, the
performance of the database systems in small organizations is poor.
Meta data
A database involves specifying the data types, structures, and constraints of the data to be stored
in the database. The database definition or descriptive information is also stored by the DBMS in
the form of a database catalog or dictionary; it is called meta-data.
A database management system (DBMS) is A file management system is a type of software that
a software package designed to define, manages data files in a computer system. It has limited
manipulate, retrieve and manage data in a capabilities and is designed to manage individual or
database. group files.
Database management system is used when File System is a general, easy-to-use system to store
security constraints are high. general files which require less security and constraints.
DBMS provides a crash recovery File system doesn't have a crash mechanism, i.e., if the
mechanism, i.e., DBMS protects the user system crashes while entering some data, then the
from the system failure. content of the file will lost.
DBMS takes care of Concurrent access of In the File system, concurrent access has many
data using some form of locking. problems like redirecting the file while other deleting
Data Redundancy is less in file management Data Redundancy is more in database management
system. system.
Data Inconsistency is less in file system. Data Inconsistency is more in the file system.
DBMS software are very costly and also Flat files are cost effective.
regular update makes it costly
Database Management System stores File Management System stores unstructured data as
structured data which have well defined isolated data files/entities.
constraints and interrelation.
Application of DBMS
1. Banking: For customer information, account activities, payments, deposits, loans, etc.
2. Airlines: For reservations and schedule information. Airlines were among the first to use
databases in a geographically distributed manner - terminals situated around the world accessed
the central database system through phone lines and other data networks.
3. Universities: For student information, course registrations, and grades.
4. Credit card transactions: For purchases on credit cards and generation of monthly
statements.
5. Telecommunication: For keeping records of calls made, generating monthly bills,
maintaining balances on prepaid calling cards, and storing information about the communication
networks.
6. Finance: For storing information about stock, sales, and purchases of financial instruments
such as stocks and bonds.
7. Sales: For customer, product, and purchase information.
8. Manufacturing: For management of supply chain and for tracking production of items in
factories, inventories of items in warehouses / stores, and orders for items.
9. Human resources: For information about employees, salaries, payroll taxes and benefits, and
for generation of paychecks .
Characteristics of the Database Approach
The main characteristics of the database approach versus the file-processing approach are the
following:
⮚ Self-describing nature of a database system
Database Architecture
1. Authorization and Integrity Manager tests for the satisfaction of integrity constraints
and checks the authority of users to access data.
2. Transaction manager ensures that the database remains in a consistent state and allows
concurrent transactions to proceed without conflicting.
Data Dictionary: Data Dictionary, which stores metadata about the database, in particular the
schema of the database.
● Names of the tables, names of attributes of each table, length of attributes, and number of
rows in each table.
● Detailed information on physical database design such as storage structure, access paths,
files and record sizes.
● Usage statistics such as frequency of query and transactions.
● Data dictionary is used to actually control the data integrity, database operation and
accuracy. It may be used as a important part of the DBMS
DML Pre-compiler: It translates DML statements in a query language into low level
instructions that query evaluation engine understands. It also attempts to transform user's request
into an equivalent but more efficient form.
DDL Interpreter: It interprets the DDL statements and records them in a set of tables
containing meta data or data dictionary.
Database Administrators
⮚ In a database environment, the primary resource is the database itself, and the
secondary resource is the DBMS and related software. Administering these
resources is the responsibility of the database administrator (DBA).
⮚ The DBA is responsible for authorizing access to the database, coordinating and
monitoring its use, and acquiring software and hardware resources as needed.
⮚ The DBA is accountable for problems such as security breaches and poor system
response time. Some functions:
● Schema definition
● storage structures and access method definition
● Schema and physical organization modification
● Granting of authorization for data access
● integrity constraint specification
Database Designers
⮚ Database designers are responsible for identifying the data to be stored in the database
and for choosing appropriate structures to represent and store this data.
⮚ Database designers typically interact with each potential group of users and develop
views of the database that meet the data and processing requirements of these groups.
⮚ Each view is then analyzed and integrated with the views of other user groups. The final
database design must be capable of supporting the requirements of all user groups.
End Users
End users are the people whose jobs require access to the database for querying,
updating, and generating reports; the database primarily exists for their use. There are
several categories of end users:
Casual end users occasionally access the database, but they may need different
information each time. They use a sophisticated database query language to specify their
requests and are typically middle- or high-level managers or other occasional browsers.
Naive or parametric end users make up a sizable portion of database end users. Their
main job function revolves around constantly querying and updating the database, using
standard types of queries and updates—called canned transactions—that have been
carefully programmed and tested. The tasks that such users perform are varied:
⮚ Bank tellers check account balances and post withdrawals and deposits.
Tool developers design and implement tools—the software packages that facilitate
database modeling 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.
A database schema is the skeleton structure that represents the logical view of the
entire database. It defines how the data is organized and how the relations among them are
associated. It formulates all the constraints that are to be applied on the data.
Instances The actual data in a database may change quite frequently. The data in the database at
a particular moment in time is called a database state or snapshot. It is also called instances in
the database.
DATA MODELS
Data models define how the logical structure of a database is modeled. Data Models are
fundamental entities to introduce abstraction in a DBMS. Data models define how data is connected to
each other and how they are processed and stored inside the system. The very first data model could be
Relational Model
The relational model for database management is discovered in 1969 by English
computer scientist Edgar F. Codd, where all data is represented in terms of tuples, grouped into
relations. The relational model in DBMS is an abstract model used to organize and manage
the data stored in a database. It stores data in two-dimensional inter-related tables, also known
as relations in which each row represents an entity and each column represents the properties of
the entity.
1. Tables/Relations – In the Relational model the, relations are saved in the table format. It
is stored along with its entities. A table has two properties rows and columns. Rows
represent records and columns represent attributes.
2. Attribute/column/field: Attributes are the properties which define a relation. e.g.,
Student_Rollno, Name, etc
3. Tuple/record/row – It is nothing but a single row of a table, which contains a single
record.
4. Relation Schema: A relation schema represents the name of the relation with its
attributes.
5. Degree: The total number of attributes which in the relation is called the degree of the
relation.
6. Cardinality: Total number of rows present in the Table.
7. Relation instance – Relation instance is a finite set of tuples in the RDBMS system.
Relation instances never have duplicate tuples.
8. Attribute domain – Every attribute has some pre-defined value and scope which is
known as attribute domain
This model was designed by Peter Chen in 1976. An ER model is the logical
representation of data as objects and relationships among them. While formulating real-world
scenario into the database model, the ER Model creates entity set, relationship set, general
attributes and constraints. ER Model is best used for the conceptual design of a database.
ER Model is based on –
Levels of Data Abstraction /The Three Tier-Schema Architecture for data independence
Data Abstraction refers to the process of hiding irrelevant details from the user. So, what is the
meaning of irrelevant details? Let's understand this with one example. Example: If we want to
access any mail from our Gmail then we don't know where that data is physically stored i.e is
the data present in India or USA or what data model has been used to store that data? We are
not concerned about these things. We are only concerned with our email.
Internal Level
⮚ The internal level has an internal schema which describes the physical storage structure
of the database.
⮚ The internal schema is also known as a physical schema.
⮚ It uses the physical data model. It is used to define that how the data will be stored in a
block.
⮚ The physical level is used to describe complex low-level data structures in detail.
Conceptual Level
⮚ The conceptual schema describes the design of a database at the conceptual level.
Conceptual level is also known as logical level.
⮚ The conceptual schema describes the structure of the whole database.
⮚ The conceptual level describes what data are to be stored in the database and also
describes what relationship exists among those data.
⮚ In the conceptual level, internal details such as an implementation of the data structure
are hidden.
⮚ Programmers and database administrators work at this level.
Data Independence
⮚ Data independence can be explained using the three-schema architecture. It means user
and data should not directly interact with each other. The user should be at a different
level and the data should be present at some other level.
⮚ Data independence refers to the characteristic of being able to modify the schema at one
level of the database system without altering the schema at the next higher level.
An application interface which is called ODBC (Open Database Connectivity) an API which
allows the client-side program to call the DBMS. Today most of the DBMS offers ODBC drivers
for their DBMS. 2 tier architecture provides added security to the DBMS as it is not exposed to
the end user directly.
The user interface programs and application programs can run on the client side. When DBMS
access is required, the program establishes a connection to the DBMS (which is on the server
side); once the connection is created, the client program can communicate with the DBMS. A
standard called Open Database Connectivity. ODBC provides an application programming
interface (API), which allows client-side programs to call the DBMS, as long as both client and
server machines have the necessary software installed. Most DBMS vendors provide ODBC
drivers for their systems. A client program can actually connect to several RDBMSs and send
query and transaction requests using the ODBC API, which are then processed at the server sites.
Any query results are sent back to the client program, which can process and display the results
as needed. A related standard for the Java programming language, called JDBC, has also been
Example of Two-tier Architecture is a Contact Management System created using MS- Access.
Client: A client here stands an end user here it uses an application/ device it may be
computer - mobile etc. with software or application.
Server Application or Application Server Layer: In this layer data i.e this from the
client is validated / check and then transferred to the database layer. This layer transfer
data between client to database server. This layer uses web server / application to check
request from client. It somewhere also converts the view of data according to client
requirement.
Database Server: This layer has all the data or we can say it is our main device or server
which has all information. It takes input / request from application layer then process the
request and generate the response and forward it to the application server.
This DBMS architecture contains an Application layer between the user and the DBMS,
which is responsible for communicating the user's request to the DBMS system and send
the response from the DBMS to the user.