Unit-1 PDF Full Chapter
Unit-1 PDF Full Chapter
Unit-1 PDF Full Chapter
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.
o Database management system is a 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.
o DBMS provides an interface to perform various operations like database creation, storing data
in it, updating data, creating a table in the database and a lot more.
o It provides protection and security to the database. In the case of multiple users, it also maintains
data consistency.
Characteristics of DBMS
o It uses a digital repository established on a server to store and manage the information.
o It can provide a clear and logical view of the process that manipulates data.
o DBMS contains automatic backup and recovery procedures.
o It contains ACID properties which maintain data in a healthy state in case of failure.
o It can reduce the complex relationship between data.
o It is used to support manipulation and processing of data.
o It is used to provide security of data.
o It can view the database from different viewpoints according to the requirements of the user.
Advantages of DBMS
o Controls database redundancy: It can control data redundancy because it stores all the data
in one single database file and that recorded data is placed in the database.
o Data sharing: In DBMS, the authorized users of an organization can share the data among
multiple users.
o Easily Maintenance: It can be easily maintainable due to the centralized nature of the database
system.
o Reduce time: It reduces development time and maintenance need.
o Backup: It provides backup and recovery subsystems which create automatic backup of data
from hardware and software failures and restores the data if required.
o multiple user interface: It provides different types of user interfaces like graphical user
interfaces, application program interfaces
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 Higher impact of failure: Failure is highly impacted the database because in most of the
organization, all the data stored in a single database and if the database is damaged due to
electric failure or database corruption then the data may be lost forever.
Application of DBMS
There are different fields where a database management system is utilized. Following are a few
applications that utilize the information base administration framework.
3. Banking
Database the executive’s framework is utilized to store the exchange data of the client in the information
base.
4. Education Sector
Presently, assessments are led online by numerous schools and colleges. They deal with all assessment
information through the data set administration framework (DBMS). In spite of that understudy’s
enlistments subtleties, grades, courses, expense, participation, results, and so forth all the data is put
away in the information base.
7. Broadcast communications
Without DBMS any media transmission organization can’t think. The Database the executive’s
framework is fundamental for these organizations to store the call subtleties and month to month
postpaid bills in the information base.
9. E-Commerce Websites
These days, web-based shopping has become a major pattern. Nobody needs to visit the shop and burn
through their time. Everybody needs to shop through web based shopping sites, (for example, Amazon,
Flipkart, Snapdeal) from home. So all the items are sold and added uniquely with the assistance of the
information base administration framework (DBMS). Receipt charges, installments, buy data these are
finished with the assistance of DBMS.
11. Manufacturing
Manufacturing organizations make various kinds of items and deal them consistently. To keep the data
about their items like bills, acquisition of the item, amount, inventory network the executives,
information base administration framework (DBMS) is utilized.
14. Security
DBMS provides security features to ensure that only authorized users have access to the data.
15. Telecommunication
Database Management Systems (DBMS) are essential to the telecommunications industry because they
manage enormous volumes of data on billing, customer information, and network optimization.
1-Tier Architecture
o In this architecture, the database is directly available to the user. It means the user can directly
sit on the DBMS and uses it.
o Any changes done here will directly be done on the database itself.
o The 1-Tier architecture is used for development of the local application, where programmers
can directly communicate with the database for the quick response.
2-Tier Architecture 1. Two tier client /server architecture is used for application program that runs on
client side.
3.An interface called ODBC(open database connectivity) that an API that allow client side program to
call the DBMS.
Fig: 2-tier Architecture
3-Tier Architecture
o The 3-Tier architecture contains another layer between the client and server. In this architecture,
client can't directly communicate with the server.
o The application on the client-end interacts with an application server which further
communicates with the database system.
o End user has no idea about the existence of the database beyond the application server. The
database also has no idea about any other user beyond the application.
o The 3-Tier architecture is used in case of large web application.
Three schema Architecture 1.The overall design of the database is called the database schema.
2.The three schema architecture is also called ANSI/SPARC(American National standards Institute,
Standards Planning and requirements committee) architecture or three-level architecture.
3. The three schema architecture is also used to separate the user applications and physical database.
o The internal level has an internal schema which describes the physical storage structure of the
database.
o The internal schema is also known as a physical schema.
o It uses the physical data model. It is used to define that how the data will be stored in a block.
o The physical level is used to describe complex low-level data structures in detail.
o At the external level, a database contains several schemas that sometimes called as subschema.
The subschema is used to describe the different view of the database.
o An external schema is also known as view schema.
o Each view schema describes the database part that a particular user group is interested and hides
the remaining database from that user group.
o The view schema describes the end user interaction with database systems.
In DBMS, data abstraction is performed in layers which means there are levels of data abstraction in
DBMS that we will further study in this article. Based on these levels, the database management system
is designed.
In DBMS, there are three levels of data abstraction, which are as follows:
1. Physical or Internal Level:
The physical or internal layer is the lowest level of data abstraction in the database management system.
It is the layer that defines how data is actually stored in the database. It defines methods to access the
data in the database. It defines complex data structures in detail, so it is very complex to understand,
which is why it is kept hidden from the end user. Data Administrators (DBA) decide how to arrange
data and where to store data. The Data Administrator (DBA) is the person whose role is to manage the
data in the database at the physical or internal level. There is a data center that securely stores the raw
data in detail on hard drives at this level.
The logical or conceptual level is the intermediate or next level of data abstraction. It explains what
data is going to be stored in the database and what the relationship is between them.
It describes the structure of the entire data in the form of tables. The logical level or conceptual level is
less complex than the physical level. With the help of the logical level, Data Administrators (DBA)
abstract data from raw data present at the physical level.
View or External Level is the highest level of data abstraction. There are different views at this level
that define the parts of the overall data of the database. This level is for the end-user interaction; at this
level, end users can access the data based on their queries.
DML stands for Data Manipulation Language.It is used for accessing and manipulating data in a
database.
It allows user insert, delete, update, and retrieve data from the database. Dml is also known as
query language
o Select: It is used to retrieve data from a database.
o Insert: It is used to insert data into a table.
o Update: It is used to update existing data within a table.
o Delete: It is used to delete all records from a table.
INSERT INTO Employees (EmployeeID, EmployeeName, Role)
Integrity Constraints
o Integrity constraints are a set of rules. It is used to maintain the quality of information.
o Integrity constraints ensure that the data insertion, updating, and other processes have to be
performed in such a way that data integrity is not affected.
1. Domain constraints
o Domain constraints can be defined as the definition of a valid set of values for an attribute.
o The data type of domain includes string, character, integer, time, date, currency, etc. The value
of the attribute must be available in the corresponding domain.
Example:
Id Name Age
101 Aman 20
102 Arun
A
103 30
I
104 karan 35
o The entity integrity constraint states that primary key value can't be null.
o This is because the primary key value is used to identify individual rows in relation and if the
primary key has a null value, then we can't identify those rows.
o A table can contain a null value other than the primary key field.
Example:
Null not allowed as primary key can not contain a Null Value
3. Referential Integrity Constraints
Example:
2 Aman 30 24
3 Arun 30
18
4 Ram 25 13
18 Not Allowed as D.No 18 is not defined as primary key of the table 2 and table 1 D.no is
a foreign key defined.
Table 2
D.no D. Location
11 Delhi
24 Uttrakhand
13 Mumbai
4. Key constraints
o Keys are the entity set that is used to identify an entity within its entity set uniquely.
o An entity set can have multiple keys, but out of which one key will be the primary key.
o A primary key can contain a unique and null value in the relational table.
Example:
Aman 1st 22
102
102 Not Allowed because all value of primary key must be Unique
Relational model can represent as a table with columns and rows. Each row is known as a tuple. Each
table of the column has a name or attribute.
Attribute: It contains the name of a column in a particular table. Each attribute Ai must have a domain.
Relational instance: In the relational database system, the relational instance is represented by a finite
set of tuples. Relation instances do not have duplicate tuples.
Relational schema: A relational schema contains the name of the relation and name of all columns or
attributes.
Relational key: In the relational key, each row has one or more attributes. It can identify the row in the
relation uniquely.
Example:
In the given table, NAME, ROLL_NO, PHONE_NO, ADDRESS, and AGE are the attributes.
Properties of Relations