UNIT1DBMS
UNIT1DBMS
Roll Address
1 KOL
2 DEL
3 MUM
Roll Year
1I
2 II
3I
Year Hostel
I H1
II H2
Age and Hostel attributes are in different tables.
A database in a DBMS could be viewed by lots of different
people with different responsibilities.
Figure 1.1:
The data items within one row may belong to different data
types. On the other hand, the columns are often called Domain
or Attribute.
All the data items within a single attribute are of the same data
type.
What is Management System?
Application of DBMS:
Database Management System (DBMS) and Its
Applications:
A Database management system is a computerized record-
keeping system. It is a repository or a container for collection of
computerized data files. The overall purpose of DBMS is to
allow he users to define, store, retrieve and update the
information contained in the database on demand. Information
can be anything that is of significance to an individual or
organization.
Enterprise Information
The university clerk has now two choices: either obtain the list
of all students and extract the needed
information manually or ask a programmer to write the
necessary application program. Both alternatives are obviously
unsatisfactory. Suppose that such a program is written, and
that, several days later, the same clerk needs to trim that list to
include only those students who have taken at least 60 credit
hours. As expected, a program to generate such a list does not
exist. Again, the clerk has the preceding two options, neither of
which is satisfactory. The point here is that conventional file-
processing environments do not allow needed data to be
retrieved in a convenient and efficient manner. More responsive
data-retrieval systems are required for general use.
Security problems.
Advantages of DBMS:
Controlling of Redundancy: Data redundancy refers to the
duplication of data (i.e storing same data multiple times). In a
database system, by having a centralized database and
centralized control of data by the DBA the unnecessary
duplication of data is avoided. It also eliminates the extra time
for processing the large volume of data. It results in saving the
storage space.
9
Improved Data Sharing : DBMS allows a user to share the
data in any number of application programs.
Disadvantages of DBMS
1) It is bit complex. Since it supports multiple functionality to
give the user the best, the underlying software has become
complex. The designers and developers should have thorough
knowledge about the software to get the most out of it.
2) Because of its complexity and functionality, it uses large
amount of memory. It also needs large memory to run
efficiently.
3) DBMS system works on the centralized system, i.e.; all the
users from all over the world access this
database. Hence any failure of the DBMS, will impact all the
users.
4) DBMS is generalized software, i.e.; it is written work on the
entire systems rather specific one. Hence some of the
application will run slow.
View of Data
A database system is a collection of interrelated data and a set
of programs that allow users to access and modify these data.
A major purpose of a database system is to provide users with
an abstract view of the data. That is, the system hides certain
details of how the data are stored and maintained.
10
Data Abstraction
For the system to be usable, it must retrieve data efficiently.
The need for efficiency has led designers to use complex data
structures to represent data in the database. Since many
database-system users are not computer trained, developers
hide the complexity from users through several levels of
abstraction, to simplify users’ interactions with the system:
Figure 1.2 : Levels of Abstraction in a DBMS
This code defines a new record type called instructor with four
fields. Each field has a name and a type associated with it. A
university organization may have several such record types,
including
Data-Manipulation Language
Architecture of DBMS
1. Query Processor :
It interprets the requests (queries) received from end user via
an application program into instructions. It also executes the
user request which is received from the DML compiler.
Query Processor contains the following components –
• DML Compiler –
It processes the DML statements into low level instruction
(machine language), so that they can be executed.
• DDL Interpreter –
It processes the DDL statements into a set of table
containing meta data (data about data).
• 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 executes the DCL statements. It
is responsible for updating, storing, deleting, and retrieving
data in the database.
It contains the following components –
• 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. Thus, 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.
• 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.
2 Database Administrator
The 1980s also saw SQL become the standard language used
for databases, which we still use today.
Having earned its name the decade before, big data was a
major buzzword of the 2010 — and big data meant big
databases to house it. With the need to collect, organise and
make use of such huge reams of data, automation software
has grown a popular tool when interacting with databases.
This is the decade where the value of data truly hit the
public consciousness. And, with it, the importance of
keeping data safe. Legislation like GDPR and the NIS
directive only served to further highlight the importance of
keeping data — and so dat
Now, we can only wait to see what the future holds for the
evolution of databases.
Data Models
Introduction of ER Model
Introduction
What is an ER Diagram?
ER diagrams are used to sketch out the design of a database.
By defining the entities, their attributes, and showing the
relationships between them, an ER diagram illustrates the
logical structure of databases.ER diagrams are created based
on three basic concepts: entities, attributes, and relationships.
• Entity
• Attribute
• Relationship
Entity
Attribute(s):
Attributes are the properties which define the entity type.
For example, Roll_No, Name, DOB, Age, Address, Mobile_No
are the attributes which defines entity type Student. In ER
diagram, attribute is represented by an oval.
1. Key Attribute –
The attribute which uniquely identifies each entity in the
entity set is called key attribute.For example, Roll_No will be
unique for each student. In ER diagram, key attribute is
represented by an oval with underlying lines.
2. Composite Attribute –
An attribute composed of many other attribute is called as
composite attribute. For example, Address attribute of student
Entity type consists of Street, City, State, and Country. In ER
diagram, composite attribute is represented by an oval
comprising of ovals.
3. Multivalued Attribute –
An attribute consisting more than one value for a given entity.
For example, Phone_No (can be more than one for a given
student). In ER diagram, multivalued attribute is represented
by double oval.
4. Derived Attribute –
An attribute which can be derived from other attributes of
the entity type is known as derived attribute. e.g.; Age (can be
derived from DOB). In ER diagram, derived attribute is
represented by dashed oval.
1. Unary Relationship –
When there is only ONE entity set participating in a
relation, the relationship is called as unary relationship. For
example, one person is married to only one person.
2. Binary Relationship –
When there are TWO entities set participating in a relation,
the relationship is called as binary relationship.For example,
Student is enrolled in Course.
3. n-ary Relationship –
When there are n entities set participating in a relation, the
relationship is called as n-ary relationship.
Cardinality:
The number of times an entity of an entity set participates
in a relationship set is known as cardinality. Cardinality can
be of different types:
1. One to one – When each entity in each entity set
can take part only once in the relationship, the
cardinality is one to one. Let us assume that a male
can marry to one female and a female can marry to
one male. So the relationship will be one to one.
Using Sets, it can be represented as:
• Car
• Bike
• Bus
Each of these vehicle types is described by a set of attributes
that includes all the attributes of the entity set vehicle plus
possibly additional attributes. For example, car entities may be
described further by the attribute gear, whereas bike entities
may be described further by the attributes automatic break. The
process of designating subgroupings within an entity set is
called specialization. The specialization of vehicles allows us to
distinguish among vehicles according to whether they are cars,
buses, or bikes.
Example: There are three entities given, car, bus, and bike.
They all have some common attributes like all cars, buses, and
bikes they all have no. of tires and have some colors. So they
all can be grouped and make a superclass named a vehicle.
• Employee
• Project
• Manager
Step 2) Relationship Identification: We have the following
two relationships
Conclusion
EER Model
1. Generalization
• Generalization is the process of generalizing the entities which
contain the properties of all the generalized entities.
• It is a bottom approach, in which two lower level entities
combine to form a higher level entity.
• Generalization is the reverse process of Specialization.
• It defines a general entity type from a set of specialized entity
type.
• It minimizes the difference between the entities by identifying
the common features.
For example:
C. Category or Union
• Category represents a single super class or sub class
relationship with more than one super class.
• It can be a total or partial participation.
For example Car booking, Car owner can be a person, a bank
(holds a possession on a Car) or a company. Category (sub
class) → Owner is a subset of the union of the three super
classes → Company, Bank, and Person. A Category member
must exist in at least one of its super classes.
D. Aggregation
• Aggregation is a process that represent a relationship between
a whole object and its component parts.
• It abstracts a relationship between objects and viewing the
relationship as an object.
• It is a process when two entity is treated as a single entity.
•
In the above example, the relation between College and
Course is acting as an Entity in Relation with Student.
•