0% found this document useful (0 votes)
54 views

Dbms-Unit-1-Database and Database Users

Dbms notes

Uploaded by

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

Dbms-Unit-1-Database and Database Users

Dbms notes

Uploaded by

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

DBMS – Unit 1

Databases and
Database Users
INTRODUCTION
Introduction
 Themain purpose od database system is to manage the
data.
 Data is collection of facts, such as numbers, words,
measurements, observations or even just descriptions of
things.
 Data is the plural of datum(a single piece of information).
 When data is processed, organized, structured or presented
in a given context to make it useful or meaningful, it is
known as information.
What is 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.
Why Database?
 Manage large amounts of data: A database stores and manages a large amount
of data on a daily basis.
 Easy to update data: In a database, it is easy to update data using various Data
Manipulation Languages(DML).
 Easy to research data: It is very easy to access and research data in a database.
This is done using DQL which allow searching of any data in the database and
performing computations on it.
 Security of data: There are user logins required before accessing a database and
various access specifiers. These allow only authorized users to access the database.
 Data integrity: This is ensured in databases by using various constraints for data.
Data integrity in databases makes sure that the data is accurate and consistent in a
database.
 Accuracy: A database is accurate as it has all sorts of build in constraints, checks
etc. This means that the information available in a database is guaranteed to be
correct in most cases.
Database Management
System
 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.
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 purpose.
 User Administration: It is used for registering and monitoring users,
maintain data integrity(set of rules that are used to maintain the
information’s quality), enforcing data security, dealing with concurrency
control(a method used to manage simultaneous operations on the
database letting them interfere with each other), monitoring performance
and recovering information corrupted by unexpected failure.
The Database Approach
 TheDatabase Approach is used for storing and maintaining
the data where the data is defined once and stored in a
single location and accessed by multiple users from this
location.
Various Characteristics of Database Approach

1. Self-Describing Nature of a
Database System
In the traditional file management system, data definition was not a part of the
application, but in the database approach, the data is defined by the users and this
defined data describes itself.

What is this metadata? Metadata means data about data, like the constraints in the
database, the structure of the database, the columns of the database, etc.
2. Insulation between Programs and
Data, and Data Abstraction
 The DBMS or Database Management System provides the conceptual view of the data that is
easily readable to the user and hides many details of the data such as how the data is stored
or the constraints used on the data.
 This conceptual view is known as the data model.
 Hence the data model hides the implementation and storage details of the data thus creating
insulation between the program and the data.

For example following details of the STUDENTS database will be shown to the user,
ROLL_NO, NAME, DEPARTMENT
and the following details will not be shown as these are unnecessary for the user,
ROLL_NO is INT,
NAME is VARCHAR,
DEPARTMENT is VARCHAR
3. Support of Multiple Views
of the Data
 In the Database Approach, a single database is
implemented and multiple users access this
database.
 For example for the STUDENTS database, the
Head of the Department of CSE will only access
the students having CSE as their department,
the dean can access the student details of
every student in the STUDENTS database.
4. Sharing of Knowledge and
Multi-user Transaction Processing
A transaction is a process that is accessing one or
more databases by reading, writing, or deleting the
data records.
 Multi-userTransaction Processing as the name implies
that the database must allow multiple users to
process their respective transactions.
 It should also ensure that the transactions are
processed concurrently so that multiple users can't
change a record at the same instant.
Actors on the Scene
1. Database Administrators (DBA)
2. Database Designers
3. System Analysts
4. Application Programmers / Back-End
Developers
5. Naive Users / Parametric Users
6. Sophisticated Users
7. Casual Users / Temporary Users
Database Administrators (DBA)
 Database Administrators (DBA) are the most important type of database users in DBMS.
 Database Administrator is an individual or a team of users who define the database
schema and takes charge of controlling various levels of the database within the organization.
 They work alongside developers in order to discuss and design the overall structure of the
database including layouts, functionalities, workflow, etc.
 Database Administrators (DBAs) can grant or revoke authorization permission to all other
users at any point of time.
 They have to update the database timely in terms of technology, functionality, and
workflow in order to meet future requirements and in making the database ready for future
scope.
 Database Administrators (Database admins) are also responsible to keep a check on data
integrity, data consistency, data redundancy, hardware and software installation requirements,
and routine maintenance of the databases.
 They are also responsible for handling data loss, which can be caused due to any error or even
due to system failures.
 Database Administrators (DBAs) monitor the backup & recovery of the database records and
provide technical support as well. If the technical team raises any concern, DBAs have to resolve
it.
Database Designers?
 Database Designers are the users in DBMS who design
and create the structure of the
database including triggers, indexes, schemas, entity
relationships, tables, constraints, etc.
 Database Designers are the type of database users in
DBMS who are responsible for implementing the overall
design of the database.
 Theydecide which form of data needs to be stored, what
kind of relations exist among different entities of the
database, what will be the type of attributes etc.
Naive Users / Parametric Users
 Naive users also known as Parametric End users, don't have any
knowledge of DBMS but still frequently use the database applications
to get the desired results. (With the help of the interface provided by
the DBMS applications)
 Naive users mostly use the database to fill in or retrieve the
information.
 Naive users don't need to be aware of the presence of the database
system as they can interact with the database with the help of menu-
driven application interface.
 For example: Railway ticket booking users in general are
naive/parametric end users as they don't have much knowledge about
DBMS and directly use railway booking application to book their
tickets.
System Analyst
 System Analysts are the type of database users in DBMS
who analyze the requirements of Naive / Parametric End
users.
 It is their responsibility to check whether all the requirements of
end users are satisfied or not.
 Analyzing feasibility, economic and technical aspects are
some of the major responsibilities for a system analyst in DBMS.
 They usually check and gather all the necessary information
related to the database, and if needed, they can change
or update the final layout of the database as per requirements.
 System Analysts always make sure that the final product should
meet all the requirements.
Application Programmers / Back-End
Developers
 Application Programmers also known as Back-End Developers,
are computer professional users who are responsible for developing
the application programs or the user interface so that other users
can use these applications to interact with the database.
 Application Programmers have deep knowledge of DBMS & databases
and know everything in detail. They interact with the database
using DML (Data Manipulation Language) queries to store data
inside the database and when needed, they can also fetch the data
from it.
 When needed, Application Programmers also specify the
modifications needed in the database structure for an application.
They are efficient enough in designing or developing their database
in any language they know.
Sophisticated Users
 Sophisticated users are the type of database users in DBMS who
know DBMS (DDL & DML commands) and are familiar with the
database.
 Sophisticated users can be business analysts, engineers, scientists,
system analysts, etc.
 Sophisticated users can develop or access their database applications
according to the requirements, without actually writing the program code
for it.
 These users are also known as SQL programmers as they can
interact with the database directly using SQL queries using query
processors.
 Using SQL queries, they can fetch the data from the database. They can
also delete, update or insert new data into the database.
Casual Users / Temporary Users

 Casualusers also known as temporary users, are the type of


database users in DBMS who frequently or occasionally use
the database services.
 Casual/Temporary users have little knowledge about DBMS
and each time they try to access the database, they require
new information.
Workers behind the Scene:
 Tool developers design and implement tools—the software
packages that facilitate database modeling and design,
database system design, and improved performance. Tools are
optional packages that are often purchased separately. They
include packages for database design, performance monitoring,
natural language or graphical interfaces, prototyping,
simulation, and test data generation. In many cases,
independent software vendors develop and market these tools.
 Operators and maintenance personnel (system
administration personnel) are responsible for the actual running
and maintenance of the hardware and software environment
for the database system.
Advantages of Using DBMS Approach
 Data Security: As the number of users increases, the data transferring or data sharing
rate also increases thus increasing the risk of data security. A Database Management
System (DBMS) provides a better platform for data privacy and security policies thus,
helping companies to improve Data Security.
 Data integration: Due to the Database Management System we have access to well-
managed and synchronized forms of data thus it makes data handling very easy and
gives an integrated view of how a particular organization is working and also helps to
keep track of how one segment of the company affects another segment.
 Data abstraction: The major purpose of a database system is to provide users with an
abstract view of the data. Since many complex algorithms are used by the developers
to increase the efficiency of databases that are being hidden by the users through
various data abstraction levels to allow users to easily interact with the system.
 Reduction in data Redundancy: When working with a structured database, DBMS
provides the feature to prevent the input of duplicate items in the database. for e.g. – If
there are two same students in different rows, then one of the duplicate data will be
deleted.
 Data sharing: A DBMS provides a platform for sharing data across multiple applications
and users, which can increase productivity and collaboration.
 Data consistency and accuracy: DBMS ensures that data is consistent and accurate by
enforcing data integrity constraints and preventing data duplication. This helps to eliminate
data discrepancies and errors that can occur when data is stored and managed manually.
 Data organization: A DBMS provides a systematic approach to organizing data in a
structured way, which makes it easier to retrieve and manage data efficiently.
 Efficient data access and retrieval: DBMS allows for efficient data access and retrieval
by providing indexing and query optimization techniques that speed up data retrieval. This
reduces the time required to process large volumes of data and increases the overall
performance of the system.
 Concurrency and maintained Atomicity: That means, if some operation is performed
on one particular table of the database, then the change must be reflected for the entire
database. The DBMS allows concurrent access to multiple users by using the
synchronization technique.
 Scalability and flexibility: DBMS is highly scalable and can easily accommodate changes
in data volumes and user requirements. DBMS can easily handle large volumes of data,
and can scale up or down depending on the needs of the organization. It provides flexibility
in data storage, retrieval, and manipulation, allowing users to easily modify the structure
and content of the database as needed.
A Brief History of Database Applications
 1. Early Database Applications Using Hierarchical and Network Systems
Many early database applications maintained records in large
organizations such as corporations, universities, hospitals, and banks. In
many of these applications, there were large numbers of records of similar
structure. For example, in a university application, similar information
would be kept for each student, each course, each grade record, and so
on. There were also many types of records and many interrelationships
among them.
One of the main problems with early database systems was the
intermixing of conceptual relationships with the physical storage and
placement of records on disk. Hence, these systems did not provide
sufficient data abstraction and program-data independence capabilities.
2. Providing Data Abstraction and
Application Flexibility with Relational
Databases
 Relational databases were originally proposed to separate the
physical storage of data from its conceptual representation and to
provide a mathematical foundation for data representation and
querying. The relational data model also introduced high-level query
languages that provided an alternative to programming language
interfaces, making it much faster to write new queries.
 Relational systems were initially targeted to the same applications as
earlier systems, and provided flexibility to develop new queries
quickly and to reorganize the database as requirements changed.
Hence, data abstraction and program-data independence were much
improved when compared to earlier systems.
3. Object-Oriented Applications and the
Need for More Complex Databases
 The emergence of object-oriented programming
languages in the 1980s and the need to store and share
complex, structured objects led to the development of
object-oriented databases (OODBs).
 Initially, OODBs were considered a competitor to
relational databases, since they provided more general
data structures. They also incorporated many of the
useful object-oriented paradigms, such as abstract data
types, encapsulation of operations, inheritance, and
object identity.
4. Interchanging Data on the Web for E-
Commerce Using XML

 The World Wide Web provides a large network of


interconnected computers. Users can create documents using
a Web publishing language, such as HyperText Markup
Language (HTML), and store these documents on Web
servers where other users (clients) can access them.
Documents can be linked through hyperlinks, which are
pointers to other documents.
5. Extending Database Capabilities for
New Applications
 he success of database systems in traditional applications encouraged developers of
other types of applications to attempt to use them. Such applications tradition-ally used
their own specialized file and data structures. Database systems now offer extensions to
better support the specialized requirements for some of these applications.
 The following are some examples of these applications:
 Storage and retrieval of images, including scanned news or personal photo-graphs,
satellite photographic images, and images from medical procedures such as x-rays and
MRIs (magnetic resonance imaging).
 Storage and retrieval of videos, such as movies, and video clips from news or
personal digital cameras.
 Data mining applications that analyze large amounts of data searching for the
occurrences of specific patterns or relationships, and for identifying unusual patterns in
areas such as credit card usage.
when not to use a dbms.
 While database management systems (DBMS) are powerful tools for storing and managing data,
there are situations where they might not be the best fit. Here are some scenarios where alternative
approaches might be preferable:
1. Small, Simple Datasets:
 If you're dealing with a very small dataset (e.g., a few dozen entries), a simple spreadsheet program
like Microsoft Excel or Google Sheets might be sufficient. Spreadsheets can be easier to set up and
use for basic data organization and manipulation for limited datasets.
2. Unstructured or Semi-structured Data:
 Traditional relational databases (RDBMS) excel with structured data organized in tables with rows
and columns. However, if your data is unstructured (e.g., text documents, emails, social media
posts) or semi-structured (e.g., JSON, XML), an RDBMS might not be the most efficient choice.
Consider NoSQL databases designed for handling these types of data more effectively.
3. Frequent Schema Changes:
 The schema in a database refers to the structure of the tables, including data types, relationships,
and constraints. If you anticipate frequent changes to your data model (how your data is organized),
a rigid relational schema might become cumbersome to modify. For situations with evolving data
structures, alternative solutions like document stores or key-value stores might offer more flexibility.
4. Simple Data Sharing or Collaboration:
 For basic data sharing or collaborative editing needs, cloud-based storage solutions
like Dropbox or Google Drive might be easier to use and share than setting up a full-
fledged DBMS.

5. Real-time Analytics or High-velocity Data:


 Traditional DBMS might not be ideal for real-time analytics or high-velocity data
streams (e.g., sensor data, stock tickers). Consider specialized stream processing
engines or in-memory databases designed for handling such high-volume, real-time
data processing.

6. Limited Resources or Technical Expertise:


 Implementing and maintaining a DBMS can require technical expertise and ongoing
server resources. If you have limited resources or lack the technical knowledge to
manage a DBMS, exploring simpler data storage options like flat files or cloud storage
solutions might be more practical.
Data Model
Data Model
 Data Models define how the logical structure of a database is modeled.
 Data Models are fundamental entities to introduce abstraction in a DBMS.
 Data models define how data is connected to each other and how they are
processed and stored inside the system.
 Some of the Data Models in DBMS are:
1. Hierarchical Model
2. Network Model
3. Entity-Relationship Model
4. Relational Model
5. Object-Oriented Data Model
6. Object-Relational Data Model
7. Flat Data Model
8. Semi-Structured Data Model
9. Associative Data Model
10. Context Data Model
Hierarchical Model
 Hierarchical Model was the first DBMS model.
 This model organises the data in the hierarchical tree structure.
 The hierarchy starts from the root which has root data and then it expands
in the form of a tree adding child node to the parent node.
 This model easily represents some of the real-world relationships like food
recipes, sitemap of a website etc.
 Example: We can represent the relationship between the shoes present
on a shopping website in the following way:
Features of a Hierarchical Model
 One-to-many relationship: The data here is organised in a tree-like
structure where the one-to-many relationship is between the datatypes.
Also, there can be only one path from parent to any node. Example: In the
above example, if we want to go to the node sneakers we only have one
path to reach there i.e through men's shoes node.
 Parent-Child Relationship: Each child node has a parent node but a
parent node can have more than one child node. Multiple parents are not
allowed.
 Deletion Problem: If a parent node is deleted then the child node is
automatically deleted.
 Pointers: Pointers are used to link the parent node with the child node and
are used to navigate between the stored data. Example: In the above
example the ' shoes ' node points to the two other nodes ' women shoes '
node and ' men's shoes ' node.
Advantages of Hierarchical Model
 It is very simple and fast to traverse through a tree-like structure.
 Any change in the parent node is automatically reflected in the
child node so, the integrity of data is maintained.

Disadvantages of Hierarchical Model


 Complex relationships are not supported.
 As it does not support more than one parent of the child node so if
we have some complex relationship where a child node needs to
have two parent node then that can't be represented using this
model.
 If a parent node is deleted then the child node is automatically
deleted.
Network Model
 This model is an extension of the hierarchical model.
 It was the most popular model before the relational model.
 This model is the same as the hierarchical model, the only difference
is that a record can have more than one parent.
 It replaces the hierarchical tree with a graph.
 Example: In the example below we can see that node student has
two parents i.e. CSE Department and Library. This was earlier not
possible in the hierarchical model.
Features of a Network Model
 Ability to Merge more Relationships: In this model, as there are
more relationships so data is more related. This model has the
ability to manage one-to-one relationships as well as many-to-many
relationships.
 Many paths: As there are more relationships so there can be more
than one path to the same record. This makes data access fast and
simple.
 Circular Linked List: The operations on the network model are
done with the help of the circular linked list. The current position is
maintained with the help of a program and this position navigates
through the records according to the relationship.
Advantages of Network Model
 The data can be accessed faster as compared to the hierarchical model.
This is because the data is more related in the network model and there
can be more than one path to reach a particular node. So the data can
be accessed in many ways.
 As there is a parent-child relationship so data integrity is present. Any
change in parent record is reflected in the child record.
Disadvantages of Network Model
 As more and more relationships need to be handled the system might
get complex. So, a user must be having detailed knowledge of the
model to work with the model.
 Any change like updation, deletion, insertion is very complex.
Entity-Relationship Model
 Entity-Relationship Model or simply ER Model is a high-level data model
diagram.
 In this model, we represent the real-world problem in the pictorial form to
make it easy for the stakeholders to understand.
 It is also very easy for the developers to understand the system by just
looking at the ER diagram.
 We use the ER diagram as a visual tool to represent an ER Model. ER diagram
has the following three components:
 Entities: Entity is a real-world thing. It can be a person, place, or even a
concept. Example: Teachers, Students, Course, Building, Department, etc are
some of the entities of a School Management System.
 Attributes: An entity contains a real-world property called attribute. This is
the characteristics of that attribute. Example: The entity teacher has the
property like teacher id, salary, age, etc.
 Relationship: Relationship tells how two attributes are
related. Example: Teacher works for a department.
In the above diagram, the entities are Teacher and Department. The
attributes of Teacher entity are Teacher_Name, Teacher_id, Age, Salary,
Mobile_Number. The attributes of entity Department entity are Dept_id,
Dept_name. The two entities are connected using the relationship. Here,
each teacher works for a department.
Features of ER Model

 Graphical Representation for Better Understanding: It is


very easy and simple to understand so it can be used by the
developers to communicate with the stakeholders.
 ER Diagram: ER diagram is used as a visual tool for
representing the model.
 Database Design: This model helps the database designers to
build the database and is widely used in database design.
Advantages of ER Model
 Simple: Conceptually ER Model is very easy to build. If we know the
relationship between the attributes and the entities we can easily build
the ER Diagram for the model.
 Effective Communication Tool : This model is used widely by the database
designers for communicating their ideas.
 Easy Conversion to any Model : This model maps well to the relational
model and can be easily converted relational model by converting the ER
model to the table. This model can also be converted to any other model
like network model, hierarchical model etc.
Disadvantages of ER Model
 No industry standard for notation: There is no industry standard for
developing an ER model. So one developer might use notations which are
not understood by other developers.
 Hidden information: Some information might be lost or hidden in the ER
model. As it is a high-level view so there are chances that some details of
information might be hidden.
Relational Model
 Relational Model is the most widely used model. In this model, the
data is maintained in the form of a two-dimensional table.
 All the information is stored in the form of row and columns.
 The basic structure of a relational model is tables. So, the tables are
also called relations in the relational model.
 Example: In this example, we have an Employee table.
Features of Relational Model

 Tuples : Each row in the table is called tuple. A row contains all
the information about any instance of the object. In the above
example, each row has all the information about any specific
individual like the first row has information about John.
 Attribute or field: Attributes are the property which defines the
table or relation. The values of the attribute should be from the
same domain. In the above example, we have different attributes
of the employee like Salary, Mobile_no, etc.
Advantages of Relational Model
 Simple: This model is more simple as compared to the network and hierarchical
model.
 Scalable: This model can be easily scaled as we can add as many rows and columns
we want.
 Structural Independence: We can make changes in database structure without
changing the way to access the data. When we can make changes to the database
structure without affecting the capability to DBMS to access the data we can say that
structural independence has been achieved.
Disadvantages of Relational Model
 Hardware Overheads: For hiding the complexities and making things easier for the
user this model requires more powerful hardware computers and data storage
devices.
 Bad Design: As the relational model is very easy to design and use. So the users
don't need to know how the data is stored in order to access it. This ease of design
can lead to the development of a poor database which would slow down if the
database grows.
 But all these disadvantages are minor as compared to the advantages of the
relational model. These problems can be avoided with the help of proper
implementation and organisation.
Object-Oriented Data Model
 The real-world problems are more closely represented through the
object-oriented data model.
 In this model, both the data and relationship are present in a single
structure known as an object.
 We can store audio, video, images, etc in the database which was not
possible in the relational model(although you can store audio and
video in relational database, it is adviced not to store in the relational
database).
 In this model, two are more objects are connected through links. We
use this link to relate one object to other objects. This can be
understood by the example given below.
In the above example, we have two objects Employee and
Department. All the data and relationships of each object are
contained as a single unit. The attributes like Name, Job_title of the
employee and the methods which will be performed by that object
are stored as a single object. The two objects are connected
through a common attribute i.e the Department_id and the
communication between these two will be done with the help of this
common id.
Object-Relational Model
 As the name suggests it is a combination of both the relational model and the object-
oriented model. This model was built to fill the gap between object-oriented model
and the relational model. We can have many advanced features like we can make
complex data types according to our requirements using the existing data types. The
problem with this model is that this can get complex and difficult to handle. So,
proper understanding of this model is required.

Flat Data Model


 It is a simple model in which the database is represented as a table consisting of rows
and columns. To access any data, the computer has to read the entire table. This
makes the modes slow and inefficient.

Semi-Structured Model
 Semi-structured model is an evolved form of the relational model. We cannot
differentiate between data and schema in this model.
 Example: Web-Based data sources which we can't differentiate between the schema
and data of the website. In this model, some entities may have missing attributes
while others may have an extra attribute. This model gives flexibility in storing the
data. It also gives flexibility to the attributes.
 Example: If we are storing any value in any attribute then that value can be either
atomic value or a collection of values.
Associative Data Model
 Associative Data Model is a model in which the data is divided into two
parts. Everything which has independent existence is called as
an entity and the relationship among these entities are
called association . The data divided into two parts are called items and
links.
 Item : Items contain the name and the identifier(some numeric value).
 Links: Links contain the identifier, source, verb and subject.
 Example : Let us say we have a statement "The world cup is being
hosted by London from 30 May 2020". In this data two links need to be
stored:
 The world cup is being hosted by London. The source here is 'the
world cup', the verb 'is being' and the target is 'London'.
 ...from 30 May 2020. The source here is the previous link, the verb is
'from' and the target is '30 May 2020'.
Context Data Model

 Context Data Model is a collection of several models.


 This consists of models like network model, relational models etc.
 Using this model we can do various types of tasks which are not
possible using any model alone.

You might also like