2. FILE SYSTEM Vs DBMS
DBMS FILE SYSTEM
• It is a collection of data. In DBMS,
the user is not required to write the
procedures.
• Gives an abstract view of data that
hides the details.
• Provides a crash recovery
mechanism, i.e., DBMS protects the
user from the system failure.
• Provides a good protection
mechanism.
• Contains a wide variety of
sophisticated techniques to store
and retrieve the data.
• Takes care of Concurrent access of
data using some form of locking.
• File system is a collection of data. In this
system, the user has to write the procedures
for managing the database.
• Provides the detail of the data
representation and storage of data.
• Doesn't have a crash mechanism, i.e., if the
system crashes while entering some data,
then the content of the file will lost.
• It is very difficult to protect a file under the
file system.
File system can't efficiently store and
retrieve the data.
• In the file system, concurrent access has
many problems like redirecting the file
while other deleting some information or
updating some information.
3. DATABASE:
• Database is an organized collection of inter-related data stored
together with minimum redundancy, in a manner that makes them
accessible for multiple applications.
• DBMS contains information about particular enterprise
Collection of interrelated data
Set of programs to access the data
An environment that is both convenient and efficient to use
• Database Applications:
Banking: all transactions
Airlines: reservations, schedules
Universities: registration, grades
Sales: customers, products, purchases
Online retailers:
Manufacturing
Human resources
4. ADVANTAGES OF DBMS:
• Controlling data redundancy
• Data consistency
• Efficient data access
• Data integrity
• Data security
• Sharing of data
• Enforcement of standars
• Crash recovery
5. Relational Dtabase Management
System(RDBMS):
• It is a collection of relations as database.
• It performs a wide array of tasks.
• It acts as an interface between the physical storage and
the logical presentation of data.
• It provides a set of tools for handling information.
• Use these tools to
Define a database
Query the database
Add, edit and delete data
Modify the structure of the database
Secure data from public access
Communicate within the network
Export and import data
7. Contd..
• PHYSICAL LEVEL/INTERNAL SCHEMA
The internal level has an internal schema which describes the
physical storage structure of the database.
It uses the physical data model. It is used to define that how the
data will be stored in a block.
The physical level is used to describe complex low-level data
structures in detail.
• LOGICAL LEVEL/CONCEPTUAL LEVEL:
Describes the design of a database at the conceptual level
It describes the structure of whole database.
Describes what data are to be stored in the database and also
describes what relationship exists among those data.
Here internal details such as an implementation of the data
structure are hidden
Programmers and database administrators work at this level.
8. Contd..
• VIEW LEVEL/EXTERNAL LEVEL:
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.
Each view schema describes the database part that a
particular user group is interested and hides the
remaining database from that user group.
The view schema describes the end user interaction
with database systems.
9. DATA INDEPENDENCE:
• Data independence can be explained using the
three-schema architecture.
• The ability to modify the schema definition(data
structure definition) in one level without
affecting the schema definition at the next
higher level is called data independence.
• There are two levels of data independence:
Physical data independence
Logical data independence.
10. Contd..
• PHYSICAL DATA INDEPENDENCE:
It refers to the ability to modify the schema followed at the
physical level without affecting the schema followed at the
conceptual level.
Physical data independence is used to separate conceptual
levels from the internal levels.
Physical data independence occurs at the logical interface
level.
If we do any changes in the storage size of the database
system server, then the Conceptual structure of the
database will not be affected.
The application programs remain the same even though the
schema at physical level gets modified.
11. Contd
• LOGICAL DATA INDEPENDENCE:
It refers to the ability to modify a conceptual level
schema without causing any changes in the schema
followed at the view(external)level.
Logical data independence is used to separate the
external level from the conceptual view.
If we do any changes in the conceptual view of the
data, then the user view of the data would not be
affected.
Logical data independence occurs at the user interface
level.
Logical data independence ensures that the
application programs remain the same.
12. INTRODUCTION TO DATABASE DESIGN:
• ENTITIES: It can be a real-world object with an
existence, that can be easily identifiable. For
example, in a school database, students, teachers,
classes, and courses offered can be considered as
entities. All these entities have some attributes or
properties that give them their identity.
• ENTITY SETS: is a collection of similar types of
entities. An entity set may contain entities with
attribute sharing similar values. For example, a
Students set may contain all the students of a
school; likewise a Teachers set may contain all the
teachers of a school from all faculties. Entity sets
need not be disjoint.
13. TYPES OF ENTITY SETS:
STRONG ENTITY SET: WEAK ENTITY SET:
• A single rectangle is used for the
representation of a strong entity set.
• It contains sufficient attributes to
form its primary key.
• A diamond symbol is used for the
representation of the relationship
that exists between the two strong
entity sets.
• A single line is used for the
representation of the connection
between the strong entity set and
the relationship.
• Total participation may or may not
exist in the relationship.
• A double rectangle is used for the
representation of a weak entity set.
• It does not contain sufficient
attributes to form its primary key.
• A double diamond symbol is used
for the representation of the
identifying relationship that exists
between the strong and weak entity
set.
• A double line is used for the
representation of the connection
between the weak entity set and the
relationship set.
• Total participation always exists in
the identifying relationship.
14. ATTRIBUTES:
• Entities are represented by means of their
properties, called attributes. All attributes have
values.
• There exists a domain or range of values that can be
assigned to attributes. For example, a student's
name cannot be a numeric value.
• These attribute types can come together in a way
like −
simple single-valued attributes
simple multi-valued attributes
composite single-valued attributes
composite multi-valued attributes
15. TYPES OF ATTRIBUTES:
• Types of Attributes
• Simple attribute − Simple attributes are atomic values, which cannot be
divided further. For example, a student's phone number is an atomic value
of 10 digits.
• Composite attribute − Composite attributes are made of more than one
simple attribute. For example, a student's complete name may have
first_name and last_name.
• Derived attribute − Derived attributes are the attributes that do not exist
in the physical database, but their values are derived from other attributes
present in the database. For example, average_salary in a department
should not be saved directly in the database, instead it can be derived. For
another example, age can be derived from data_of_birth.
• Single-value attribute − Single-value attributes contain single value. For
example − Social_Security_Number.
• Multi-value attribute − Multi-value attributes may contain more than
one values. For example, a person can have more than one phone number,
email_address, etc
16. RELATIONSHIP:
• Association among several entities is called
relationship. For example, an
employee works_at a department, a
student enrolls in 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
called descriptive attributes.
17. DEGREE OF RELATIONSHIP SETS:
• The number of participating entities in a
relationship defines the degree of the relationship.
• Binary = degree 2
• Ternary = degree 3
• n-ary = degree
• Types of realtionship sets:
Unary relationship set
Binary relationship set
Ternary relationship set
n-ary relationship set
18. TYPES OF RELATIONSHIP SETS:
• Unary relationship set is a relationship set where
only one entity set participates in a relationship set.
• Binary relationship set is a relationship set where
two entity sets participate in a relationship set.
• Ternary relationship set is a relationship set where
three entity sets participate in a relationship set.
• N-ary relationship set is a relationship set where ‘n’
entity sets participate in a relationship set.
19. DIFFERENT TYPES OF RELATIONAL
DATABASE MODELS:
• One to One Relationship (1:1): It is used to
create a relationship between two tables in which a
single row of the first table can only be related to
one and only one records of a second table.
Similarly, the row of a second table can also be
related to anyone row of the first table.
• One to Many Relationship: It is used to create a
relationship between two tables. Any single rows of
the first table can be related to one or more rows of
the second tables, but the rows of second tables can
only relate to the only row in the first table. It is also
known as a many to one relationship.
20. Contd..
• Many to Many Relationship: It is many to
many relationships that create a relationship
between two tables. Each record of the first table
can relate to any records (or no records) in the
second table. Similarly, each record of the
second table can also relate to more than one
record of the first table. It is also represented
an N:N relationship.
21. ER MODEL:
• ER model stands for an Entity-Relationship
model. It is a high-level data model. This model
is used to define the data elements and
relationship for a specified system.
• It develops a conceptual design for the database.
It also develops a very simple and easy to design
view of data.
• In ER modeling, the database structure is
portrayed as a diagram called an entity-
relationship diagram.