Unit 1
Unit 1
1.1 Introduction:
Database is a collection of related data and data is a collection of facts and figures that
can be processed to produce information.
A database management system stores data in such a way that it becomes easier to
retrieve, manipulate, and produce information.
1- end users
2- database designers
3- database administrators
4- application programmers
1
Users
A typical DBMS has users with different rights and permissions who use it for different
purposes.
End Users − End users are those who actually benefits from the DBMS.
Advantages of DBMS
2
o Controls database redundancy: DBMS can control data duplication.
o Data sharing: In DBMS, multiple users can share the data.
o Easily Maintenance: It can be easily maintainable.
o Reduce time: It reduces development time and maintenance need.
o Backup: DBMS creates automatic backup of data and restores the data if required.
o multiple user interface: It provides different types of user interfaces like
graphical user interfaces, application program interfaces
1-Tier Architecture
3
In this architecture, the database is directly available to the user.
Any changes done here will directly be done on the database
2-Tier Architecture
3-Tier Architecture
4
In this architecture, client can't directly communicate with the server.
The application on the client-end interacts with an application server which further
communicates with the database system.
Application (Middle) Tier − At this tier reside the application server and the programs
that access the database.
User (Presentation) Tier − End-users operate on this tier and they know nothing about
any existence of the database beyond this layer.
5
Data models define how the logical structure of a database is modeled.
Data models define how data is connected to each other and how they are processed and
stored inside the system.
1. flat data-models
flat data-models, where all the data used are to be kept in the same plane.
2. Entity-Relationship Model
ER Model is based on −
Example :
6
Entity − An entity in an ER Model is a real-world entity having properties
called attributes.
Mapping cardinalities −
one to one
one to many
many to one
many to many
3. Relational Model
The most popular data model in DBMS is the Relational Model. It is more scientific
a model than others.
7
Relation: A relation is a table with columns and rows.
Attribute: An attribute is a named column of a relation.
Domain: A domain is the set of allowable values for one or more attributes.
Tuple: A tuple is a row of a relation.
o The data which is stored in the database at a particular moment of time is called an
instance of the database.
o The overall design of a database is called schema.
o A database schema is the skeleton structure of the database. It represents the
logical view of the entire database.
8
Database Schema
9
A physical schema can be defined as the design of a database at its physical level. In this
level, it is expressed how data is stored in blocks of storage.
A logical schema can be defined as the design of the database at its logical level. It
defines tables, etc.
A View schema can be defined as the design of the database at view level which
generally describes end-user interaction with database systems.
Data Independence
Logical data independence can be defined as the immunity of the external schemas to
changes in the conceptual schema
If we do some changes on table format, it should not change the data residing on the disk.
Physical data independence can be defined as the immunity of the conceptual schema to
changes in the internal schema..
For example, in case we want to change or upgrade the storage system itself − suppose
we want to replace hard-disks with SSD − it should not have any impact on the logical
data or schemas.
10