0% found this document useful (0 votes)
39 views74 pages

Dbms Unit-1 Notes

This is the notes I have been used

Uploaded by

baghelkavi501
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views74 pages

Dbms Unit-1 Notes

This is the notes I have been used

Uploaded by

baghelkavi501
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 74

UNIT-1

RITUMBARA CHAUHAN
DATA
• Data are observations or measurements
(unprocessed or processed) represented as
text, numbers, or multimedia. A dataset is a
structured collection of data generally
associated with a unique body of work. A
database is an organized collection of data
stored as multiple datasets.
Information
• Information in DBMS is processed, organized,
or summarized data. It may be defined as a
collection of related data that, when put
together, becomes a useful message to a
recipient.
• Data is the raw material that can be processed
for any computing machine. Information is the
data that has been converted.
Datum
• Data are individual facts that are out of context,
have no meaning, and are difficult to
understand. They are often referred to as raw
data. The term data is plural, equivalent to facts,
while datum is singular, equivalent to a fact.
• Datum is singular, meaning "one piece of
information" or "one numerical result." Data is
the plural form of datum and should not be used
as a singular noun.
Database

• The database is a collection of inter-related data


which is used to retrieve, insert and delete the
data efficiently. It is also used to organize the data
in the form of a table, schema, views, and reports,
etc.
• For example: The college Database organizes the
data about the admin, staff, students and faculty
etc.
• Using the database, you can easily retrieve, insert,
and delete the information.
Database-management system
• A database-management system (DBMS) is a collection
of interrelated data and a set of programs to access those
data. This is a collection of related data with an implicit
meaning and hence is a database.
• Database management system is a software which is used
to manage the database. For example: MYSQL Oracle etc
are a very popular commercial database which is used in
different applications.
• DBMS provides an interface to perform various operations
like database creation, storing data in it, updating data,
creating a table in the database and a lot more.
• It provides protection and security to the database. In the
case of multiple users, it also maintains data consistency.
What is a File System?

• A file system is a method of storing files such as a


hard disc, pen drive, DVD, etc. in the media. It lets
you organize the data and enables the files to be
readily available as needed. It typically consists of
various types of files, such as mp3, txt, mp4, doc,
etc. You can read and write data in the storage
medium via a file system. It is installed directly on
the computer with Windows and Linux operating
systems. In this article, we will discuss the
difference between DBMS vs File System.
Advantages of File Processing System
:
• Cost friendly –
There is a very minimal to no set up and usage fee for
File Processing System. (In most cases, free tools are
inbuilt in computers.)

• Easy to use –
File systems require very basic learning and
understanding, hence, can be easily used.

• High scalability –
One can very easily switch from smaller to larger files
as per his needs.
Disadvantages of File Processing
System :
• Slow access time – Direct access of files is very difficult and one needs to know the entire hierarchy of
folders to get to a specific file. This involves a lot of time.

• Presence of redundant data – The same data can be present in two or more files which takes up more disc
space.

• Inconsistent Data – Due to data redundancy, same data stored at different places might not match to each
other.

• Data Integrity Problems – The data present in the database should be consistent and correct. To achieve
this, the data should must satisfy certain constraints.

• Difficulty in recovery of corrupt data – Recovery or backup of lost and corrupt data is nearly impossible
in case of File Processing System.

• Lack of Atomicity – Operations performed in the database must be atomic i.e. either the operation takes
place as a whole or does not take place at all.

• Problem in Concurrent Access – When a number of users operates on a common data in database at the
same time then anomalies arise, due to lack of concurrency control.
• Unauthorized Access – Anyone who gets access to the file can read or modify the data.
DBMS allows users the following
tasks:
• Data Definition: It is used for creation, modification, and
removal of definition that defines the organization of data in
the database.
• Data Updation: It is used for the insertion, modification,
and deletion of the actual data in the database.
• Data Retrieval: It is used to retrieve the data from the
database which can be used by applications for various
purposes.
• User Administration: It is used for registering and
monitoring users, maintain data integrity, enforcing data
security, dealing with concurrency control, monitoring
performance and recovering information corrupted by
unexpected failure.
Characteristics of DBMS

• A database management system is able to store any kind of data in


a database.
• The database management system has to support ACID (atomicity,
consistency, isolation, durability) properties.
• The Database management system allows so many users to access
databases at the same time.
• Backup and recovery are the two main methods which allow users
to protect the data from damage or loss.
• It also provides multiple views for different users in a single
organization.
• It follows the concept of normalization which is helpful to
minimize the redundancy of a relation.
• It also provides users query language, helpful to insert, retrieve,
update, and delete the data in a database.
Advantages of DBMS
Reducing Data Redundancy
• The file based data management systems
contained multiple files that were stored in many
different locations in a system or even across
multiple systems. Because of this, there were
sometimes multiple copies of the same file which
lead to data redundancy.
• This is prevented in a database as there is a single
database and any change in it is reflected
immediately. Because of this, there is no chance of
encountering duplicate data.
….ADVANTAGES
Sharing of Data
• In a database, the users of the database can share
the data among themselves. There are various
levels of authorisation to access the data, and
consequently the data can only be shared based
on the correct authorisation protocols being
followed.
• Many remote users can also access the database
simultaneously and share the data between
themselves.
….ADVANTAGES
Data Integrity
• Data integrity means that the data is accurate
and consistent in the database. Data Integrity
is very important as there are multiple
databases in a DBMS. All of these databases
contain data that is visible to multiple users.
So it is necessary to ensure that the data is
correct and consistent in all the databases and
for all the users.
….ADVANTAGES
• Data Security
• Data Security is vital concept in a database.
Only authorised users should be allowed to
access the database and their identity should
be authenticated using a username and
password. Unauthorised users should not be
allowed to access the database under any
circumstances as it violates the integrity
constraints.
….ADVANTAGES
Privacy
• The privacy rule in a database means only the
authorized users can access a database
according to its privacy constraints. There are
levels of database access and a user can only
view the data he is allowed to. For example -
In social networking sites, access constraints
are different for different accounts a user may
want to access.
….ADVANTAGES
Backup and Recovery
• Database Management System automatically
takes care of backup and recovery. The users
don't need to backup data periodically
because this is taken care of by the DBMS.
Moreover, it also restores the database after a
crash or system failure to its previous
condition.
….ADVANTAGES
Data Consistency
• Data consistency is ensured in a database
because there is no data redundancy. All data
appears consistently across the database and
the data is same for all the users viewing the
database. Moreover, any changes made to the
database are immediately reflected to all the
users and there is no data inconsistency.
Disadvantages of DBMS
• 1. High Cost
• The high cost of software and hardware is the
main disadvantage of the database management
system.
• Database users require a high-speed processor
and huge memory size to use the database on the
DBMS. Sometimes, users require costly machines
for maintaining databases.
• Organizations need a trained and highly paid
technical database administrator for using and
maintaining the large database systems.
…. Disadvantages
• 2. Huge Size
• The size of the database is not big at the initial
state, but when the user stores a large amount
of data, then it creates many problems. Due to
the huge data, database systems do not
provide good results and do not run
efficiently. That's why the size is another
limitation of the database systems.
…. Disadvantages
• 3. Database Failure
• In the database systems, all the data or
information of an organization is stored in one
centralized database. If the database of that
organization fails, then the data is lost, and the
organization will collapse. So, database failure
is a big problem with the database
management system.
…. Disadvantages
• 4. Complexity
• Database management system (DBMS) is so
complex for non-technical users. So, it isn't
easy to manage and maintain database
systems. Therefore, training for the designers,
users, and administrators is necessary to
efficiently run the database systems.
…. Disadvantages
• 5. Increased Staff Cost
• DBMS requires an educated and skilled staff for
managing and maintaining the databases. So, we
need to spend a lot of money to get this level of
trained and experienced staff.
• 6. Requirement of Technical Staff
• A non-technical people can't understand the
complexity of the database. So, the technical staff
is required for maintaining and handling the
database management system.
…. Disadvantages
• 7. Cost of Data Conversion
• It is one of the big disadvantages of the database
management system because the cost of data
conversion is very high. There is a requirement for
trained, skilled, and experienced database
administrators for converting the data smoothly.
• 8. Performance
• Performance is another big disadvantage of database
systems because the speed of the database systems
for small firms and organizations is very slow. Hence,
the performance of the database systems in small
organizations is poor.
DBMS Architecture

• The DBMS design depends upon its architecture.


The basic client/server architecture is used to deal
with a large number of PCs, web servers, database
servers and other components that are connected
with networks.
• The client/server architecture consists of many
PCs and a workstation which are connected via
the network.
• DBMS architecture depends upon how users are
connected to the database to get their request
done.
Types of DBMS Architecture
1-Tier Architecture

• In this architecture, the database is directly


available to the user. It means the user can
directly sit on the DBMS and uses it.
• Any changes done here will directly be done on
the database itself. It doesn't provide a handy tool
for end users.
• The 1-Tier architecture is used for development of
the local application, where programmers can
directly communicate with the database for the
quick response.
2-Tier Architecture

• The 2-Tier architecture is same as basic client-server. In


the two-tier architecture, applications on the client
end can directly communicate with the database at
the server side. For this interaction, API's
like: ODBC, JDBC are used.
• The user interfaces and application programs are run
on the client-side.
• The server side is responsible to provide the
functionalities like: query processing and transaction
management.
• To communicate with the DBMS, client-side
application establishes a connection with the server
side.
3-Tier Architecture

• The 3-Tier architecture contains another layer


between the client and server. 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.
• End user has no idea about the existence of the
database beyond the application server. The database
also has no idea about any other user beyond the
application.
• The 3-Tier architecture is used in case of large web
application.
Three schema Architecture

• The three schema architecture is also called


ANSI/SPARC architecture or three-level
architecture.
• This framework is used to describe the structure
of a specific database system.
• The three schema architecture is also used to
separate the user applications and physical
database.
• The three schema architecture contains
three-levels. It breaks the database down into
three different categories.
Objectives of Three schema
Architecture
• Different users need different views of the same data.
• The approach in which a particular user needs to see the data may
change over time.
• The users of the database should not worry about the physical
implementation and internal workings of the database such as
data compression and encryption techniques, hashing,
optimization of the internal structures etc.
• All users should be able to access the same data according to their
requirements.
• DBA should be able to change the conceptual structure of the
database without affecting the user's
• Internal structure of the database should be unaffected by
changes to physical aspects of the storage.
Three schema Architecture Levels
• External level
• Conceptual level
• Internal level
External/ View level
• This is the highest level of database
abstraction. It includes a number of external
schemas or user views. This level provides
different views of the same database for a
specific user or a group of users. An external
view provides a powerful and flexible security
mechanism by hiding the parts of the
database from a particular user.
Conceptual or Logical level
• This level describes the structure of the whole
database. It acts as a middle layer between the
physical storage and user view. It explains what data to
be stored in the database, what the data types are,
and what relationship exists among those data. There
is only one conceptual schema per database.
• This level describes the structure of the whole
database. It acts as a middle layer between the
physical storage and user view. It explains what data to
be stored in the database, what the data types are,
and what relationship exists among those data. There
is only one conceptual schema per database.
Internal or Physical level
• This is the lowest level of database abstraction. It
describes how the data is stored in the database and
provides the methods to access data from the
database. It allows viewing the physical representation
of the database on the computer system.
• The interface between the conceptual and internal
schema identifies how an element in the conceptual
schema is stored and how it may be accessed. It is one
which is closest to physical storage. The internal
schema not only defines different stored record types,
but also specifies what indices exist, how stored fields
are represented.
Mapping between Views

There are basically two types of mapping in


the database architecture:
• Conceptual/ Internal Mapping
• External / Conceptual Mapping
• Conceptual/ Internal Mapping
• The Conceptual/ Internal Mapping lies between the
conceptual level and the internal level. Its role is to
define the correspondence between the records and
fields of the conceptual level and files and data
structures of the internal level.

• External/ Conceptual Mapping


• The external/Conceptual Mapping lies between the
external level and the Conceptual level. Its role is to
define the correspondence between a particular
external and the conceptual view.
DATA MODELS
• 1) Relational Data Model: This type of model designs the
data in the form of rows and columns within a table. Thus, a
relational model uses tables for representing data and
in-between relationships. Tables are also called relations.
This model was initially described by Edgar F. Codd, in 1969.
The relational data model is the widely used model which is
primarily used by commercial data processing applications.
• 2) Entity-Relationship Data Model: An ER model is the
logical representation of data as objects and relationships
among them. These objects are known as entities, and
relationship is an association among these entities. This
model was designed by Peter Chen and published in 1976
papers. It was widely used in database designing. A set of
attributes describe the entities. For example,
student_name, student_id describes the 'student' entity. A
set of the same type of entities is known as an 'Entity set',
and the set of the same type of relationships is known as
'relationship set'.
• 3) Object-based Data Model: An extension of the ER model with
notions of functions, encapsulation, and object identity, as well. This
model supports a rich type system that includes structured and
collection types. Thus, in 1980s, various database systems following the
object-oriented approach were developed. Here, the objects are
nothing but the data carrying its properties.

• 4) SemI-structured Data Model: This type of data model is different


from the other three data models (explained above). The
semi-structured data model allows the data specifications at places
where the individual data items of the same type may have different
attributes sets. The Extensible Markup Language, also known as XML, is
widely used for representing the semi-structured data. Although XML
was initially designed for including the markup information to the text
document, it gains importance because of its application in the
exchange of data.
Data model Schema and Instance

• The data which is stored in the database at a particular moment of


time is called an instance of the database.
• The overall design of a database is called schema.
• A database schema is the skeleton structure of the database. It
represents the logical view of the entire database.
• A schema contains schema objects like table, foreign key, primary
key, views, columns, data types, stored procedure, etc.
• A database schema can be represented by using the visual
diagram. That diagram shows the database objects and
relationship with each other.
• A database schema is designed by the database designers to help
programmers whose software will interact with the database. The
process of database creation is called data modeling.
Data Independence

• Data independence can be explained using the


three-schema architecture.
• Data independence refers characteristic of
being able to modify the schema at one level
of the database system without altering the
schema at the next higher level.
1. Logical Data Independence

• Logical data independence refers characteristic of


being able to change the conceptual schema
without having to change the external schema.
• 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.
2. Physical Data Independence

• Physical data independence can be defined as the


capacity to change the internal schema without
having to change the conceptual schema.
• 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.
• Physical data independence is used to separate
conceptual levels from the internal levels.
• Physical data independence occurs at the logical
interface level.
DBA
(Database Administrator)
• A Database Administrator (DBA) is individual
or person responsible for controlling,
maintenance, coordinating, and operation of
database management system. Managing,
securing, and taking care of database system is
prime responsibility.
Role and Duties of Database
Administrator (DBA) :
• Decides hardware –
They decides economical hardware, based upon cost, performance and
efficiency of hardware, and best suits organisation. It is hardware which is
interface between end users and database.
• Manages data integrity and security –
Data integrity need to be checked and managed accurately as it protects
and restricts data from unauthorized use. DBA eyes on relationship within
data to maintain data integrity.
• Database design –
DBA is held responsible and accountable for logical, physical design,
external model design, and integrity and security control.
• Database implementation –
DBA implements DBMS and checks database loading at time of its
implementation.
• Query processing performance –
DBA enhances query processing by improving their speed, performance
and accuracy.
• Tuning Database Performance –
If user is not able to get data speedily and accurately then it may loss
organization business. So by tuning SQL commands DBA can enhance
performance of database.
Key responsibilities of a database
designer
• understand the organisation's data to skillfully carry out the company's
database design projects
• install and configure relational database management system on the
company's server
• design database schemas and create databases for varied projects of the
company
• handle the creation of new users, define roles and privileges and grant
access to them
• assist application development teams to easily connect to the databases
• track the performance of the databases and fix issues quickly to facilitate
smooth functioning
• use the best techniques for enhanced scalability and efficiency of large
databases
• understand complex problems, devise solutions and transform them into
software requirements
• conduct data research and query large and complex datasets to provide
the best data modelling
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.
• For example, Suppose we design a school database. In this
database, the student will be an entity with attributes like address,
name, id, age, etc. The address can be another entity with
attributes like city, street name, pin code, etc and there will be a
relationship between them.
Component of ER Diagram
1. Entity:

• An entity may be any object, class, person or


place. In the ER diagram, an entity can be
represented as rectangles.
• Consider an organization as an example-
manager, product, employee, department etc.
can be taken as an entity.
….Entity
Strong Entity
• Strong Entity is independent to any other entity in the
schema. A strong entity always have a primary key. In
ER diagram, a strong entity is represented by
rectangle. Relationship between two strong entities is
represented by a diamond. A set of strong entities is
known as strong entity set.
Weak Entity
• Weak entity is dependent on strong entity and cannot
exists without a corresponding strong. It has a foreign
key which relates it to a strong entity. A weak entity is
represented by double rectangle.
Differences between Strong Entity and
Weak Entity.
2. Attribute

• The attribute is used to describe the property


of an entity. Eclipse is used to represent an
attribute.
• For example, id, age, contact number, name,
etc. can be attributes of a student.

a. Key Attribute

• The key attribute is used to represent the


main characteristics of an entity. It represents
a primary key. The key attribute is represented
by an ellipse with the text underlined.
b. Composite Attribute
• An attribute that composed of many other
attributes is known as a composite attribute.
The composite attribute is represented by an
ellipse, and those ellipses are connected with
an ellipse.
c. Multivalued Attribute
• An attribute can have more than one value.
These attributes are known as a multivalued
attribute. The double oval is used to represent
multivalued attribute.
• For example, a student can have more than
one phone number.

d. Derived Attribute
• An attribute that can be derived from other attribute is known
as a derived attribute. It can be represented by a dashed
ellipse.
• For example, A person's age changes over time and can be
derived from another attribute like Date of birth.
3. Relationship

• A relationship is used to describe the relation


between entities. Diamond or rhombus is
used to represent the relationship.
Types of relationship
a. One-to-One Relationship
• When only one instance of an entity is
associated with the relationship, then it is
known as one to one relationship.
• For example, A female can marry to one male,
and a male can marry to one female.
b. One-to-many relationship
• When only one instance of the entity on the left, and
more than one instance of an entity on the right
associates with the relationship then this is known as
a one-to-many relationship.
• For example, Scientist can invent many inventions,
but the invention is done by the only specific
scientist.
c. Many-to-one relationship
• When more than one instance of the entity on the
left, and only one instance of an entity on the right
associates with the relationship then it is known as a
many-to-one relationship.
• For example, Student enrolls for only one course, but
a course can have many students.
d. Many-to-many relationship
• When more than one instance of the entity on the
left, and more than one instance of an entity on the
right associates with the relationship then it is known
as a many-to-many relationship.
• For example, Employee can assign by many projects
and project can have many employees.
Extended ER Model Cocepts:

• Generalization
• Specialization
• Aggregration
Generalization

• Generalization is a bottom-up approach in which


two lower level entities combine to form a higher
level entity. In generalization, the higher level
entity can also combine with other lower level
entities to make further higher level entity.
• It's more like Superclass and Subclass system, but
the only difference is the approach, which is
bottom-up. Hence, entities are combined to form
a more generalised entity, in other words,
sub-classes are combined to form a super-class.
• For example, Saving and Current account
types entities can be generalised and an entity
with name Account can be created, which
covers both.
Specialization
• Specialization is opposite to Generalization. It
is a top-down approach in which one higher
level entity can be broken down into two
lower level entity. In specialization, a higher
level entity may not have any lower-level
entity sets, it's possible.

Aggregration

• Aggregration is a process when relation


between two entities is treated as a single
entity.

You might also like