Professional Documents
Culture Documents
Basics of DBMS and E R Diagram
Basics of DBMS and E R Diagram
What is a Database?
A database is a collection of related data which represents
some aspect of the real world.
What is DBMS?
Database Management System (DBMS) is a software for
storing and retrieving users' data while considering
appropriate security measures. It consists of a group of
programs which manipulate the database
Physical Level
This is the lowest level in the three level architecture. It is also
known as the internal level. The physical level describes how
data is actually stored in the database.
At the physical level, the information about the location of
database objects in the data store is kept. Various users of
DBMS are unaware of the locations of these objects.In simple
terms,physical level of a database describes how the data is
being stored in secondary storage devices like disks and tapes
and also gives insights on additional storage details.
Conceptual Level
The conceptual level is at a higher level than the physical
level. It is also known as the logical level.
At conceptual level, data is represented in the form of various
database tables. For Example, STUDENT database may
contain STUDENT and COURSE tables which will be visible
to users but users are unaware of their storage.Also referred as
logical schema,it describes what kind of data is to be stored in
the database.
The conceptual level does not care for how the data in the
database is actually stored.
External Level
This is the highest level in the three level architecture and
closest to the user. It is also known as the view level. The
external level only shows the relevant database content to the
users in the form of views and hides the rest of the data. So
different users can see the database as a different view as per
their individual requirements.
An external level specifies a view of the data in terms of
conceptual level tables. Each external level view is used to
cater to the needs of a particular category of users. For
Example, FACULTY of a university is interested in looking
course details of students, STUDENTS are interested in
looking at all details related to academics, accounts, courses
and hostel details as well. So, different views can be generated
for different users. The main focus of external level is data
abstraction.
View of data In dbms
schema
Whenever we talk about the database the developers have to
deal with the definition of database and the data in the
database.
E-R Model
Relational Model
Hierarchical Model
o one to many
o many to one
o many to many
Student college
A simple ER Diagram:
Weak Entity:
An entity that cannot be uniquely identified by its own
attributes and relies on the relationship with other entity is
called weak entity. The weak entity is represented by a double
rectangle. For example – a bank account cannot be uniquely
identified without knowing the bank to which the account
belongs, so bank account is a weak entity.
2. Attribute
An attribute describes the property of an entity. An attribute is
represented as Oval in an ER diagram. There are four types of
attributes:
1. Key attribute
2. Composite attribute
3. Multivalued attribute
4. Derived attribute
1. Key attribute:
A key attribute can uniquely identify an entity from an entity
set.
2. Composite attribute:
An attribute that is a combination of other attributes is known
as composite attribute. For example, In student entity, the
student address is a composite attribute as an address is
composed of other attributes such as pin code, state, country.
3. Multivalued attribute:
An attribute that can hold multiple values is known as
multivalued attribute. It is represented with double ovals in an
ER Diagram. For example – A person can have more than one
phone numbers so the phone number attribute is multivalued.
4. Derived attribute:
A derived attribute is one whose value is dynamic and derived
from another attribute. It is represented by dashed oval in an
ER Diagram. For example – Person age is a derived attribute
as it changes over time and can be derived from another
attribute (Date of birth).
E-R diagram with multivalued and derived attributes:
Types of relationships
1. One to One Relationship
When a single instance of an entity is associated with a single
instance of another entity then it is called one to one
relationship. For example, a person has only one passport and
a passport is given to one person.
Generalization
Specialization Example
g
>