Database Management System: Arpit Madaan
Database Management System: Arpit Madaan
MANAGEMENT SYSTEM
WHAT IS DATA?
Database is a collection of related data and data is a
collection of facts and figures that can be processed to
produce information.
Consistency
Consistency is a state where every relation in a database remains consistent.
There exist methods and techniques, which can detect attempt of leaving
database in inconsistent state. A DBMS can provide greater consistency as
compared to earlier forms of data storing applications like file-processing
systems.
ACID Properties (Atomicity, Consistency,Isolation, andDurability)
Atomic Transaction
Anatomic transactionis a series of database operations such that eitheralloccur, ornothingoccurs. Example:
Airline Ticket Booking
Consistency
The guarantee that database constraints are not violated, particularly once a transaction commits
Isolation
Isolation determines how transaction integrity is visible to other users and systems.
Serializable
Repeatable Reads
Read Committed
Read Un-Committed
Durability
Guarantees that transactions that have committed will survive permanently.
For example, if a flight booking reports that a seat has successfully been booked, then the seat will remain booked
even if the system crashes.
Durability can be achieved by flushing the transaction's log records to non-volatile storage before acknowledging
commitment.
Multiuser and Concurrent Access
DBMS supports multi-user environment and allows them to access and manipulate data in
parallel. Though there are restrictions on transactions when users attempt to handle the same
data item, but users are always unaware of them.
Multiple views
DBMS offers multiple views for different users. A user who is in the Sales department will have a
different view of database than a person working in the Production department. This feature
enables the users to have a concentrate view of the database according to their requirements.
Security
Features like multiple views offer security to some extent where users are unable to access
data of other users and departments.
DBMS offers methods to impose constraints while entering data into the database and
retrieving the same at a later stage.
For example, a user in the Sales department cannot see the data that belongs to the Purchase
department. Additionally, it can also be managed how much data of the Sales department should
be displayed to the user. Since a DBMS is not saved on the disk as traditional file systems, it is
very hard for miscreants to break the code.
1 & 2 TIER ARCHITECTURE
Tier 1-
In 1-tier architecture, the DBMS is the only entity where the user directly
sits on the DBMS and uses it. Any changes done here will directly be done
on the DBMS itself. It does not provide handy tools for end-users. Database
designers and programmers normally prefer to use single-tier architecture.
Tier 2-
If the architecture of DBMS is 2-tier, then it must have an application
through which the DBMS can be accessed. Programmers use 2-tier
architecture where they access the DBMS by means of an application.
Here the application tier is entirely independent of the database in terms
of operation, design, and programming.
3-TIER ARCHITECTURE
Database (Data) Tier At this tier, the database resides along
with its query processing languages. We also have the relations
that define the data and their constraints at this level.
Many to
Many
Many to
A person can have many Oneaddresses but if
reverse this, then many addresses belongs
to one person.
Means many entities belongs to one entity.
RELATIONAL MODEL
The most popular data model in DBMS is the Relational Model. It is
Simple
Attribute
Multivalued
Attribute
Derived
Attribute
ENTITY-SET AND KEYS
Key is an attribute or collection of attributes that uniquely identifies an entity among entity set.
For example, the roll_number of a student makes him/her identifiable among students.
1. Super Key A set of attributes (one or more) that collectively identifies an entity in an
entity set. A superkey is a combination of columns that uniquely identifies any row within a
relational database management system (RDBMS) table. A candidate key is a closely related
concept where the superkey is reduced to the minimum number of columns required to
uniquely identify each row.
2. Candidate Key Acandidate keyis a column, or set of columns, in a table that can
uniquely identify any database record without referring to any other data. Each table may
have one or morecandidate keys, but onecandidate keyis special, and it is called the
primarykey.
3. Primary Key A primary key is one of the candidate keys chosen by the database designer
to uniquely identify the entity set. Aprimary key'smain features are: It must contain a
unique value for each row of data. It cannot contain null values.
Table: Super Keys
Customer
Name+SSN+Birthdate
Customer ID+Name+SSN Primary Key
name
Customer ID SSN
Social security ID
number (SSN) Candidate Keys
Address
Date of birth ID+SSN
RELATIONSHIPS
The association among entities is called a relationship. For
example, an employeeworks_ata department, a
studentenrollsin a course. Here, Works_at and Enrolls are called
relationships.
Relationship Sets
A set of relationships of similar type is called a relationship set. Like
entities, a relationship too can have attributes. These attributes are
calleddescriptive attributes.
MAPPING CARDINALITIES
Cardinalitydefines the number of entities in one entity set, which
can be associated with the number of entities of other set via
relationship set.
1. One-to-one One entity from entity set A can be associated
with at most one entity of entity set B and vice versa.
One-to-many
One entity from entity set A can be associated with more than one entities of entity set
B however an entity from entity set B, can be associated with at most one entity.
Many-to-one
More than one entities from entity set A can be associated with at most one entity of entity
set B, however an entity from entity set B can be associated with more than one entity
from entity set A.
Many-to-many One entity from A can be associated with more
than one entity from B and vice versa.
GENERALIZATION
As mentioned above, the process of generalizing entities, where the
generalized entities contain the properties of all the generalized
entities, is called generalization. In generalization, a number of
entities are brought together into one generalized entity based on
their similar characteristics. For example, pigeon, house sparrow,
crow and dove can all be generalized as Birds.
SPECIALIZATION
Specialization is the opposite of
generalization. In specialization, a group
of entities is divided into sub-groups
based on their characteristics.
Take a group Person for example. A
person has name, date of birth, gender,
etc. These properties are common in all
persons, human beings. But in a
company, persons can be identified as
employee, employer, customer, or
vendor, based on what role they play in
the company.
THANK YOU