SlideShare una empresa de Scribd logo
1 de 50
Subject Name :Database Management system(DMS)
Subject Code:22319
1
Teaching Scheme
2
UNIT NAME &
WEIGHTAGE
3
COURSE OUTCOMES
4
1.Create Database using SQL Commands.
2.Manage Database using SQL Commands.
3.Implement Advanced SQL concepts on
Database.
4.Write PL/SQL code for database application
.
5.Apply security and safety on Database
Unit- I
Database System Concept
5
Concept of Data,Database,DBMS
PCP,NIGDI, Mrs.S.S.Jogdand 6
Definition
•Data is nothing but facts and figures that can be recorded in system and have
some special meaning assigned to it.
•In the context of computer science, it refers to information that has been
translated into a form that is efficient for movement or processing.
•For example- name, age, address, account _no. etc,
•A Database is a collection of information or facts that is organized so that it
can be easily processed, managed, controlled, accessed or updated.
•In a banking application, data is the whole collection of bank account numbers;
bank customers’names, addresses, and ages; bank transactions and so on.
•Data in database can be added, updated, modified, expanded and deleted.
or information relevant to an any
7
•Definition:-
Database: The collection of interrelated data
enterprise is called as Database .
Database Management System (DBMS) is a collection of interrelated data and set
of programs to access those data. DBMS provides a way to store and retrieve database
information that is both convenient and efficient.
•It allowing users to store, process and analyze data easily. DBMS also provides
protection and security to the databases. It also maintains data consistency in case of
multiple users.
•DBMS provides us with an interface or a tool, to perform various operations like creating
database, storing data in it, updating data, creating tables in the database and a lot more.
•Here are some examples of popular DBMS used these days:
MySQL
Oracle
IBM DB2
PostgreSQL
MongoDB
Hadoop
Amazon SimpleDB (cloud based) etc.
File Processing System
8
•File processing system is a computer based
system in which all the information is stored in
various computer files.
•Initially file processing system was useful but as
the requirement of data processing and the size of
data increases,the drawback of the system comes
into picture.
Disadvantage of File System
9
• Data Redundancy
• Data Inconsistency
• Limited Concurrency
• Problem of Data Security
• Poor Security
Advantages of DBMS over file System –
10
•To provide data sharing
•Reduction of Data Redundancy
•Avoiding Inconsistency
•Transactional Support
•Maintaining Integrity
•Enforcement of Security
Applications of Database
11
• Railway Reservation System
•Hospital Management System
•Library Management System
•Banking
•Universities and Colleges
•Online Shoppings
•Human Resource Management
1.2 Three Levels Of Database Architecture/ Three levels of
data abstraction
Three levels of DBMS
architecture:-
1.Physical Level / Internal
Schema/Internal View
2.Logical Level / Conceptual
Schema/ logical view
3.External Level / External
Schema/ External view
12
•1. Physical Level
•Physical level describes the physical storage structure of data in database.
•It is also known as Internal Level.
•This level is very close to physical storage of data.
•At lowest level, data is stored in the form of bits with the physical addresses on
the secondary storage device.
•At highest level, it can be viewed in the form of files.
•The internal schema defines the various stored data types. It uses a physical data
model.
13
•2. Conceptual Level
•Conceptual level describes the structure of the whole database for a group of
users.
•It is also called as the data model.
•Conceptual schema is a representation of the entire content of the database.
•These schema contains all the information to build relevant external records.
•It hides the internal details of physical storage.
14
•3. External Level
•External level is related to the data which is viewed by individual end users.
•This level includes a no. of user views or external schema.
•This level is closest to the user.
•External view describes the segment of the database that is required for a
particular user group and hides the rest of the database from that user group.
1.3 Data Abstraction
•Database systems are made-up of complex data structures. To ease the user
interaction with database, the developers hide internal irrelevant details
from users. This process of hiding irrelevant details from user is called data
abstraction.
15
Three levels of Data Abstraction:
16
•Physical level: This is the lowest level of data abstraction. It describes how
data is actually stored in database. You can get the complex data structure
details at this level.
•Logical level: This is the middle level of 3-level data abstraction architecture.
It describes what data is stored in database.
•At view level, user just interact with system with the help of GUI and enter the
details at the screen, they are not aware of how the data is stored and what
data is stored; such details are hidden from them.
Instance and Schema in DBMS
17
•Definition of schema: Design of a database is called the schema. Schema can
be changed infrequently as information is inserted and deleted.
•Database system have three types of schema - Physical schema, logical
schema and view schema.
•The design of a database at physical level is called physical schema, how the
data stored in blocks of storage is described at this level.
•Design of database at logical level is called logical schema, programmers and
database administrators work at this level, at this level data can be described as
certain types of data records gets stored in data structures, however the internal
details such as implementation of data structure is hidden at this level
(available at physical level).
•Design of database at view level is called view schema. This generally
describes end user interaction with database systems.
•Definition of instance: The data stored in database at a particular
moment of time is called instance of database.
•Database schema defines the variable declarations in tables that
belong to a particular database; the value of these variables at a
moment of time is called the instance of that database.
18
Data Independence
•Definition-The ability to modify a schema definition in one level without
affecting a schema definition in a higher level is called Data Independence.
•Types of Data Independence:
1) Physical data independence
•The ability to modify the physical schema without causing application
programs to be rewritten
•Modifications at this level are usually to improve performance
2) Logical data independence
•The ability to modify the conceptual schema without causing application
programs to be rewritten
•Usually done when logical structure of database is altered
•Logical data independence is harder to achieve as the application programs
are usually heavily dependent on the logical structure of the data. An analogy
is made to abstract data types in program
19
ming languages.
1.4 Components And Overall Structure of DBMS.
20
Components of DBMS are broadly classified as follows :
1.Users:
(a)Naïve User
(b)Application User
(c)Sophisticated User
(d)Database Administrator
2. Query Processor :
(a) DML Compiler
(b) Embedded DML pre-compiler
(c) DDL Interpreter
(d) Query Evaluation Engine
3. Storage Manager :
(a) Authorization and Integrity Manager
(b) Transaction Manager
(c) File Manager
(d) Buffer Manager
4. Data Structure :
(a) Data Files
(b) Data Dictionary
(c) Indices
(d) Statistical Data
21
1. Query Processor Components :
•DML Pre-compiler : It translates DML statements in a query
language into low level instructions that query evaluation engine
understands. It also attempts to transform user's request into an
equivalent but more efficient form.
•Embedded DML Pre-compiler : It converts DML statements
embedded in an application program to normal procedure calls in
the host language. The Pre-compiler must interact with the DML
compiler to generate the appropriate code.
•DDL Interpreter : It interprets the DDL statements and records
them in a set of tables containing meta data or data dictionary.
•Query Evaluation Engine : It executes low-level instructions
generated by the DML compiler.
22
2. Storage Manager Components :
They provide the interface between the low-level data stored in the database and
application programs and queries submitted to the system.
•Authorization and Integrity Manager : It tests for the satisfaction of integrity
constraints checks the authority of users to access data.
•Transaction Manager : It ensures that the database remains in a consistent state
despite the system failures and that concurrent transaction execution proceeds
without conflicting.
•File Manager : It manages the allocation of space on disk storage and the data
structures used to represent information stored on disk.
•Buffer Manager : It is responsible for fetching data from disk storage into main
memory and deciding what data to cache in memory.
3. Data Structures :
Following data structures are required as a part of the physical system
implementation.
• Data Files : It stores the database.
•Data Dictionary : It stores meta data (data about data) about the structure of
the database.
• Indices : Provide fast access to data items that hold particular values.
• Statistical Data : It stores statistical information about the data in the database.
23
This information is used by query processor to select efficient ways to execute
Data Models in DBMS
A Data Model is a logical structure of Database. It describes the design of
database to reflect entities, attributes, relationship among data, constrains etc.
Types of Data Models:
a) Object based logical Models – Describe data at the conceptual and view
levels.
•E-R Model
•Object oriented Model
b) Record based logical Models – Like Object based model, they also
describe data at the conceptual and view levels. These models specify
logical structure of database with records, fields and attributes.
•Relational Model
•Hierarchical Model
•Network Model
c) Physical Data Models – These models describe data at the lowest level of
abstraction. 24
Hierarchical model
•A hierarchical data model is a data model which the data is
organized into a tree like structure.
•The structure allows repeating information using parent/child
relationships: each parent can have many children but each child
only has one parent. All attributes of a specific record are listed
under an entity type
•This model was primarily used by IBM’s Information
Management Systems in the 60s and 70s, but they are rarely seen
today due to certain operational inefficiencies.
Fig: Hierarchical Da
2t
5
a model
Network model
•The network model builds on the hierarchical model by allowing
multiple
many-to-many relationships between linked records, implying
parent records.
•Based on mathematical set theory, the model is constructed with sets of
related records. Each set consists of one owner or parent record and one or
more member or child records. A record can be a member or child in multiple
sets, allowing this model to convey complex relationships.
•It was most popular in the 70s after it was formally defined by the Conference
on Data Systems Languages (CODASYL).
26
Fig: Network Data Model
Relational Data Model
27
•The most common model, the relational model sorts data into tables, also
known as relations, each of which consists of columns and rows. Each
column lists an attribute of the entity in question, such as price, zip code, or
birth date. Together, the attributes in a relation are called a domain. A
particular attribute or combination of attributes is chosen as a primary key that
can be referred to in other tables, when it’s called a foreign key.
•Each row, also called a tuple, includes data about a specific instance of the
entity in question, such as a particular employee.
•The model also accounts for the types of relationships between those tables,
including one-to-one, one-to-many, and many-to-many relationships.
• Relational databases are typically written in Structured Query Language
(SQL). The model was introduced by E.F. Codd in 1970.
Fig: Relational Data Model
28
1.6 Data Modelling Using E-R model
29
•E-R Model-An entity relationship model, also called an
Entity-Relationship Diagram (ERD), is a graphical representation of
entities and their relationships to each other.
•An entity is a piece of data - an “object” or a “thing” in real world that
is distinguishable from other objects.
•ERD can express the overall logical structure of database graphically.
•Following are the terminologies and notations used in ERD.
Entity
30
•An entity can be a real-world object, either animate or
inanimate, 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.
•An entity set 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.
ER Diagrams Symbols, And Notations
PCP,NIGDI, Mrs.S.S.Jogdand 31
Strong Entity
32
•Strong Entity:-The Strong Entity is the one whose existence does not
depend on the existence of any other entity in a schema.
•It is denoted by a single rectangle.
•A strong entity always has the primary key in the set of attributes
that describes the strong entity.
•It indicates that each entity in a strong entity set can be uniquely
identified.
•Set of similar types of strong entities together forms the Strong Entity
Set. A strong entity holds the relationship with the weak entity via an
Identifying Relationship, which is denoted by double diamond in the
ER diagram. On the other hands, the relationship between two strong
entities is denoted by a single diamond and it is simply called as a
relationship.
•Let us understand this concept with the help of an example; a
customer borrows a loan. Here we have two entities first a customer
entity, and second a loan entity.
Fig: ERD
33
Weak entity
PCP,NIGDI, Mrs.S.S.Jogdand 34
• Weak entity is the one that depends on its owner entity ( i.e. a strong
entity) for its existence.
• An entity that does not have a primary key is referred to as a weak entity .
• A weak entity is denoted by the double rectangle.
• Weak entity do not have the primary key instead it has a partial key.
•Partial Key: Specifies a key that is only partially unique. Used for weak
entities that uniquely discriminates the weak entities.
•The collection of similar weak entities is called Weak Entity Set. The
relationship between a weak entity and a strong entity is always denoted with
an Identifying Relationship i.e. double diamond.
Comparison
ASIS FOR COMPARISON STRONG ENTITY WEAK ENTITY
Basic The Strong entity has a
primary key
The weak entity has a
partial discriminator key.
Depends The Strong entity is
independent of any other
entity in a schema.
Weak entity depends on
the strong entity for its
existence.
Denoted
Relation
Strong entity is denoted by
a single rectangle.
The relation between two
strong entities is denoted
by a single diamond simply
called relationship.
Weak entity is denoted with
the double rectangle.
The relationship between a
weak and a strong entity is
denoted by Identifying
Relationship denoted with
double diamond.
Participation Weak entity always has
total participation in the
identifying relationship
Strong entity may or may
not have total p3a5rticipation
in the relationship.
Components of an E-R diagram
•Entity:- Any real-world object can be represented as an entity
about which data can be stored in a database. All the real world
objects like a book, an organization, a product, a car, a person are
the examples of an entity. Any living or non-living objects can be
represented by an entity. An entity is symbolically represented by
a rectangle enclosing its name.
Entity
36
Entities can be characterized into two types:
•Strong entity: A strong entity has a primary key attribute which
uniquely identifies each entity. Symbol of strong entity is same as
an entity.
Strong Entity
Weak entity: A weak entity does not have a primary key
attribute and depends on other entity via a foreign key attribute.
37
Attributes
•Entities are represented by means of their properties, called attributes. All
attributes have values. For example, a Car entity may have color, price, and
registration no., model no. as attributes.
•There exists a domain or range of values that can be assigned to attributes. For
example, a car name cannot be a numeric value. It has to be alphabetic. A s car
registration nocannot be negative, etc.
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.
PCP,NIGDI, Mrs.S.S.Jogdand 38
•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.
39
•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.
40
* Entity-Set and Keys:
•Key: Key is an attribute or collection of attributes that uniquely
identifies an entity among entity set.
For example, the roll_number of a student makes him/her identifiable
among students.
•Super Key − A set of attributes (one or more) that collectively
identifies an entity in an entity set.
•Candidate Key − A minimal super key is called a candidate key. An
entity set may have more than one candidate key.
•Primary Key − A primary key is one of the candidate keys chosen by
the database designer to uniquely identify the entity set.
41
Relationship: The association among entities is called a relationship.
For example,
an employee works_at a department,
a student enrolls in a course.
An employee assigned a project.
Teacher teaches a student.
Author writes a book.
A diamond is used to symbolically represent a relationship in the E-R diagram.
Relationship Set
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.
Degree of Relationship
The number of participating entities in a relationship defines the degree of the relationship.
Binary = degree 2 Ternary = degree 3 n-ary = degree
* Relationship
42
E-R Diagram
43
* Mapping Cardinalities
Cardinality defines the number of entities in one entity set, which can be associated
with the number of entities of other set via relationship set.
One-to-one − One entity from entity set A can be associated with at most one entity
of entity set B and vice versa.
44
One-to-many − One entity from entity set A can be associated with more than one entities of entity set B
however an entity from entity set B, can be associated with at most one entity.
Many-to-one − More than one entities from entity set A can be associated with
at most one entity of entity set B, however an entity from entity set B can be
associated with more than one entity from entity set A
45
Many-to-many − One entity from A can be associated with more than
one entity from B and vice versa.
PCP,NIGDI, Mrs.S.S.Jogdand 46
•Binary Relationship and Cardinality
-A relationship where two entities are participating is called a binary relationship.
Cardinality is the number of instance of an entity from a relation that can be
associated with the relation.
1.One-to-one − When only one instance of an entity is associated with the
relationship, it is marked as '1:1'. The following image reflects that only one
instance of each entity should be associated with the relationship. It depicts
one-to-one relationship.
2. One-to-many − When more than one instance of an entity is associated with a
relationship, it is marked as '1:N'. The following image reflects that only one instance of
entity on the left and more than one instance of an entity on the right can be associated with
the relationship. It depicts one-to-many relationship.
47
Many-to-one − When more than one instance of entity is associated with the
relationship, it is marked as 'N:1'. The following image reflects that more than one
instance of an entity on the left and only one instance of an entity on the right can be
associated with the relationship. It depicts many-to-one relationship.
Many-to-many − The following image reflects that more than one instance of an
entity on the left and more than one instance of an entity on the right can be
associated with the relationship. It depicts many-to-many relationship
48
E-R diagram for library management system
PCP,NIGDI, Mrs.S.S.Jogdand 49
E-R diagram for bank management system
50

Más contenido relacionado

Similar a 01-database-management.pptx

DBMS-material for b.tech students to learn
DBMS-material for b.tech students to learnDBMS-material for b.tech students to learn
DBMS-material for b.tech students to learn
Rajasekhar364622
 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptx
AshmitKashyap1
 
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnetUtsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra
 
CP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implementCP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implement
flyinimohamed
 

Similar a 01-database-management.pptx (20)

Unit-I mech for studendts for btech .ppt
Unit-I mech for studendts for btech .pptUnit-I mech for studendts for btech .ppt
Unit-I mech for studendts for btech .ppt
 
Database Management System.pptx
Database Management System.pptxDatabase Management System.pptx
Database Management System.pptx
 
DBMS-material for b.tech students to learn
DBMS-material for b.tech students to learnDBMS-material for b.tech students to learn
DBMS-material for b.tech students to learn
 
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management system
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptx
 
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnetUtsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnet
 
Beginning Of DBMS (data base)
Beginning Of DBMS (data base)Beginning Of DBMS (data base)
Beginning Of DBMS (data base)
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
DBMS architecture &; system structure
DBMS architecture &; system  structureDBMS architecture &; system  structure
DBMS architecture &; system structure
 
CST204 DBMSMODULE1 PPT (1).pptx
CST204 DBMSMODULE1 PPT (1).pptxCST204 DBMSMODULE1 PPT (1).pptx
CST204 DBMSMODULE1 PPT (1).pptx
 
CP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implementCP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implement
 
Dbms
DbmsDbms
Dbms
 
1-introduction to DB.pdf
1-introduction to DB.pdf1-introduction to DB.pdf
1-introduction to DB.pdf
 
Database Management Systems
Database Management SystemsDatabase Management Systems
Database Management Systems
 
CS3270 - DATABASE SYSTEM - Lecture (1)
CS3270 - DATABASE SYSTEM -  Lecture (1)CS3270 - DATABASE SYSTEM -  Lecture (1)
CS3270 - DATABASE SYSTEM - Lecture (1)
 
Fundamentals of DBMS
Fundamentals of DBMSFundamentals of DBMS
Fundamentals of DBMS
 
Ch 2-introduction to dbms
Ch 2-introduction to dbmsCh 2-introduction to dbms
Ch 2-introduction to dbms
 
Unit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 CompleteUnit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 Complete
 
Overview of Data Base Systems Concepts and Architecture
Overview of Data Base Systems Concepts and ArchitectureOverview of Data Base Systems Concepts and Architecture
Overview of Data Base Systems Concepts and Architecture
 

Último

Último (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 

01-database-management.pptx

  • 1. Subject Name :Database Management system(DMS) Subject Code:22319 1
  • 4. COURSE OUTCOMES 4 1.Create Database using SQL Commands. 2.Manage Database using SQL Commands. 3.Implement Advanced SQL concepts on Database. 4.Write PL/SQL code for database application . 5.Apply security and safety on Database
  • 6. Concept of Data,Database,DBMS PCP,NIGDI, Mrs.S.S.Jogdand 6 Definition •Data is nothing but facts and figures that can be recorded in system and have some special meaning assigned to it. •In the context of computer science, it refers to information that has been translated into a form that is efficient for movement or processing. •For example- name, age, address, account _no. etc, •A Database is a collection of information or facts that is organized so that it can be easily processed, managed, controlled, accessed or updated. •In a banking application, data is the whole collection of bank account numbers; bank customers’names, addresses, and ages; bank transactions and so on. •Data in database can be added, updated, modified, expanded and deleted.
  • 7. or information relevant to an any 7 •Definition:- Database: The collection of interrelated data enterprise is called as Database . Database Management System (DBMS) is a collection of interrelated data and set of programs to access those data. DBMS provides a way to store and retrieve database information that is both convenient and efficient. •It allowing users to store, process and analyze data easily. DBMS also provides protection and security to the databases. It also maintains data consistency in case of multiple users. •DBMS provides us with an interface or a tool, to perform various operations like creating database, storing data in it, updating data, creating tables in the database and a lot more. •Here are some examples of popular DBMS used these days: MySQL Oracle IBM DB2 PostgreSQL MongoDB Hadoop Amazon SimpleDB (cloud based) etc.
  • 8. File Processing System 8 •File processing system is a computer based system in which all the information is stored in various computer files. •Initially file processing system was useful but as the requirement of data processing and the size of data increases,the drawback of the system comes into picture.
  • 9. Disadvantage of File System 9 • Data Redundancy • Data Inconsistency • Limited Concurrency • Problem of Data Security • Poor Security
  • 10. Advantages of DBMS over file System – 10 •To provide data sharing •Reduction of Data Redundancy •Avoiding Inconsistency •Transactional Support •Maintaining Integrity •Enforcement of Security
  • 11. Applications of Database 11 • Railway Reservation System •Hospital Management System •Library Management System •Banking •Universities and Colleges •Online Shoppings •Human Resource Management
  • 12. 1.2 Three Levels Of Database Architecture/ Three levels of data abstraction Three levels of DBMS architecture:- 1.Physical Level / Internal Schema/Internal View 2.Logical Level / Conceptual Schema/ logical view 3.External Level / External Schema/ External view 12
  • 13. •1. Physical Level •Physical level describes the physical storage structure of data in database. •It is also known as Internal Level. •This level is very close to physical storage of data. •At lowest level, data is stored in the form of bits with the physical addresses on the secondary storage device. •At highest level, it can be viewed in the form of files. •The internal schema defines the various stored data types. It uses a physical data model. 13
  • 14. •2. Conceptual Level •Conceptual level describes the structure of the whole database for a group of users. •It is also called as the data model. •Conceptual schema is a representation of the entire content of the database. •These schema contains all the information to build relevant external records. •It hides the internal details of physical storage. 14 •3. External Level •External level is related to the data which is viewed by individual end users. •This level includes a no. of user views or external schema. •This level is closest to the user. •External view describes the segment of the database that is required for a particular user group and hides the rest of the database from that user group.
  • 15. 1.3 Data Abstraction •Database systems are made-up of complex data structures. To ease the user interaction with database, the developers hide internal irrelevant details from users. This process of hiding irrelevant details from user is called data abstraction. 15
  • 16. Three levels of Data Abstraction: 16 •Physical level: This is the lowest level of data abstraction. It describes how data is actually stored in database. You can get the complex data structure details at this level. •Logical level: This is the middle level of 3-level data abstraction architecture. It describes what data is stored in database. •At view level, user just interact with system with the help of GUI and enter the details at the screen, they are not aware of how the data is stored and what data is stored; such details are hidden from them.
  • 17. Instance and Schema in DBMS 17 •Definition of schema: Design of a database is called the schema. Schema can be changed infrequently as information is inserted and deleted. •Database system have three types of schema - Physical schema, logical schema and view schema. •The design of a database at physical level is called physical schema, how the data stored in blocks of storage is described at this level. •Design of database at logical level is called logical schema, programmers and database administrators work at this level, at this level data can be described as certain types of data records gets stored in data structures, however the internal details such as implementation of data structure is hidden at this level (available at physical level). •Design of database at view level is called view schema. This generally describes end user interaction with database systems.
  • 18. •Definition of instance: The data stored in database at a particular moment of time is called instance of database. •Database schema defines the variable declarations in tables that belong to a particular database; the value of these variables at a moment of time is called the instance of that database. 18
  • 19. Data Independence •Definition-The ability to modify a schema definition in one level without affecting a schema definition in a higher level is called Data Independence. •Types of Data Independence: 1) Physical data independence •The ability to modify the physical schema without causing application programs to be rewritten •Modifications at this level are usually to improve performance 2) Logical data independence •The ability to modify the conceptual schema without causing application programs to be rewritten •Usually done when logical structure of database is altered •Logical data independence is harder to achieve as the application programs are usually heavily dependent on the logical structure of the data. An analogy is made to abstract data types in program 19 ming languages.
  • 20. 1.4 Components And Overall Structure of DBMS. 20
  • 21. Components of DBMS are broadly classified as follows : 1.Users: (a)Naïve User (b)Application User (c)Sophisticated User (d)Database Administrator 2. Query Processor : (a) DML Compiler (b) Embedded DML pre-compiler (c) DDL Interpreter (d) Query Evaluation Engine 3. Storage Manager : (a) Authorization and Integrity Manager (b) Transaction Manager (c) File Manager (d) Buffer Manager 4. Data Structure : (a) Data Files (b) Data Dictionary (c) Indices (d) Statistical Data 21
  • 22. 1. Query Processor Components : •DML Pre-compiler : It translates DML statements in a query language into low level instructions that query evaluation engine understands. It also attempts to transform user's request into an equivalent but more efficient form. •Embedded DML Pre-compiler : It converts DML statements embedded in an application program to normal procedure calls in the host language. The Pre-compiler must interact with the DML compiler to generate the appropriate code. •DDL Interpreter : It interprets the DDL statements and records them in a set of tables containing meta data or data dictionary. •Query Evaluation Engine : It executes low-level instructions generated by the DML compiler. 22
  • 23. 2. Storage Manager Components : They provide the interface between the low-level data stored in the database and application programs and queries submitted to the system. •Authorization and Integrity Manager : It tests for the satisfaction of integrity constraints checks the authority of users to access data. •Transaction Manager : It ensures that the database remains in a consistent state despite the system failures and that concurrent transaction execution proceeds without conflicting. •File Manager : It manages the allocation of space on disk storage and the data structures used to represent information stored on disk. •Buffer Manager : It is responsible for fetching data from disk storage into main memory and deciding what data to cache in memory. 3. Data Structures : Following data structures are required as a part of the physical system implementation. • Data Files : It stores the database. •Data Dictionary : It stores meta data (data about data) about the structure of the database. • Indices : Provide fast access to data items that hold particular values. • Statistical Data : It stores statistical information about the data in the database. 23 This information is used by query processor to select efficient ways to execute
  • 24. Data Models in DBMS A Data Model is a logical structure of Database. It describes the design of database to reflect entities, attributes, relationship among data, constrains etc. Types of Data Models: a) Object based logical Models – Describe data at the conceptual and view levels. •E-R Model •Object oriented Model b) Record based logical Models – Like Object based model, they also describe data at the conceptual and view levels. These models specify logical structure of database with records, fields and attributes. •Relational Model •Hierarchical Model •Network Model c) Physical Data Models – These models describe data at the lowest level of abstraction. 24
  • 25. Hierarchical model •A hierarchical data model is a data model which the data is organized into a tree like structure. •The structure allows repeating information using parent/child relationships: each parent can have many children but each child only has one parent. All attributes of a specific record are listed under an entity type •This model was primarily used by IBM’s Information Management Systems in the 60s and 70s, but they are rarely seen today due to certain operational inefficiencies. Fig: Hierarchical Da 2t 5 a model
  • 26. Network model •The network model builds on the hierarchical model by allowing multiple many-to-many relationships between linked records, implying parent records. •Based on mathematical set theory, the model is constructed with sets of related records. Each set consists of one owner or parent record and one or more member or child records. A record can be a member or child in multiple sets, allowing this model to convey complex relationships. •It was most popular in the 70s after it was formally defined by the Conference on Data Systems Languages (CODASYL). 26 Fig: Network Data Model
  • 27. Relational Data Model 27 •The most common model, the relational model sorts data into tables, also known as relations, each of which consists of columns and rows. Each column lists an attribute of the entity in question, such as price, zip code, or birth date. Together, the attributes in a relation are called a domain. A particular attribute or combination of attributes is chosen as a primary key that can be referred to in other tables, when it’s called a foreign key. •Each row, also called a tuple, includes data about a specific instance of the entity in question, such as a particular employee. •The model also accounts for the types of relationships between those tables, including one-to-one, one-to-many, and many-to-many relationships. • Relational databases are typically written in Structured Query Language (SQL). The model was introduced by E.F. Codd in 1970.
  • 29. 1.6 Data Modelling Using E-R model 29 •E-R Model-An entity relationship model, also called an Entity-Relationship Diagram (ERD), is a graphical representation of entities and their relationships to each other. •An entity is a piece of data - an “object” or a “thing” in real world that is distinguishable from other objects. •ERD can express the overall logical structure of database graphically. •Following are the terminologies and notations used in ERD.
  • 30. Entity 30 •An entity can be a real-world object, either animate or inanimate, 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. •An entity set 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.
  • 31. ER Diagrams Symbols, And Notations PCP,NIGDI, Mrs.S.S.Jogdand 31
  • 32. Strong Entity 32 •Strong Entity:-The Strong Entity is the one whose existence does not depend on the existence of any other entity in a schema. •It is denoted by a single rectangle. •A strong entity always has the primary key in the set of attributes that describes the strong entity. •It indicates that each entity in a strong entity set can be uniquely identified. •Set of similar types of strong entities together forms the Strong Entity Set. A strong entity holds the relationship with the weak entity via an Identifying Relationship, which is denoted by double diamond in the ER diagram. On the other hands, the relationship between two strong entities is denoted by a single diamond and it is simply called as a relationship.
  • 33. •Let us understand this concept with the help of an example; a customer borrows a loan. Here we have two entities first a customer entity, and second a loan entity. Fig: ERD 33
  • 34. Weak entity PCP,NIGDI, Mrs.S.S.Jogdand 34 • Weak entity is the one that depends on its owner entity ( i.e. a strong entity) for its existence. • An entity that does not have a primary key is referred to as a weak entity . • A weak entity is denoted by the double rectangle. • Weak entity do not have the primary key instead it has a partial key. •Partial Key: Specifies a key that is only partially unique. Used for weak entities that uniquely discriminates the weak entities. •The collection of similar weak entities is called Weak Entity Set. The relationship between a weak entity and a strong entity is always denoted with an Identifying Relationship i.e. double diamond.
  • 35. Comparison ASIS FOR COMPARISON STRONG ENTITY WEAK ENTITY Basic The Strong entity has a primary key The weak entity has a partial discriminator key. Depends The Strong entity is independent of any other entity in a schema. Weak entity depends on the strong entity for its existence. Denoted Relation Strong entity is denoted by a single rectangle. The relation between two strong entities is denoted by a single diamond simply called relationship. Weak entity is denoted with the double rectangle. The relationship between a weak and a strong entity is denoted by Identifying Relationship denoted with double diamond. Participation Weak entity always has total participation in the identifying relationship Strong entity may or may not have total p3a5rticipation in the relationship.
  • 36. Components of an E-R diagram •Entity:- Any real-world object can be represented as an entity about which data can be stored in a database. All the real world objects like a book, an organization, a product, a car, a person are the examples of an entity. Any living or non-living objects can be represented by an entity. An entity is symbolically represented by a rectangle enclosing its name. Entity 36
  • 37. Entities can be characterized into two types: •Strong entity: A strong entity has a primary key attribute which uniquely identifies each entity. Symbol of strong entity is same as an entity. Strong Entity Weak entity: A weak entity does not have a primary key attribute and depends on other entity via a foreign key attribute. 37
  • 38. Attributes •Entities are represented by means of their properties, called attributes. All attributes have values. For example, a Car entity may have color, price, and registration no., model no. as attributes. •There exists a domain or range of values that can be assigned to attributes. For example, a car name cannot be a numeric value. It has to be alphabetic. A s car registration nocannot be negative, etc. 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. PCP,NIGDI, Mrs.S.S.Jogdand 38
  • 39. •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. 39
  • 40. •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. 40
  • 41. * Entity-Set and Keys: •Key: Key is an attribute or collection of attributes that uniquely identifies an entity among entity set. For example, the roll_number of a student makes him/her identifiable among students. •Super Key − A set of attributes (one or more) that collectively identifies an entity in an entity set. •Candidate Key − A minimal super key is called a candidate key. An entity set may have more than one candidate key. •Primary Key − A primary key is one of the candidate keys chosen by the database designer to uniquely identify the entity set. 41
  • 42. Relationship: The association among entities is called a relationship. For example, an employee works_at a department, a student enrolls in a course. An employee assigned a project. Teacher teaches a student. Author writes a book. A diamond is used to symbolically represent a relationship in the E-R diagram. Relationship Set 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. Degree of Relationship The number of participating entities in a relationship defines the degree of the relationship. Binary = degree 2 Ternary = degree 3 n-ary = degree * Relationship 42
  • 44. * Mapping Cardinalities Cardinality defines the number of entities in one entity set, which can be associated with the number of entities of other set via relationship set. One-to-one − One entity from entity set A can be associated with at most one entity of entity set B and vice versa. 44
  • 45. One-to-many − One entity from entity set A can be associated with more than one entities of entity set B however an entity from entity set B, can be associated with at most one entity. Many-to-one − More than one entities from entity set A can be associated with at most one entity of entity set B, however an entity from entity set B can be associated with more than one entity from entity set A 45
  • 46. Many-to-many − One entity from A can be associated with more than one entity from B and vice versa. PCP,NIGDI, Mrs.S.S.Jogdand 46
  • 47. •Binary Relationship and Cardinality -A relationship where two entities are participating is called a binary relationship. Cardinality is the number of instance of an entity from a relation that can be associated with the relation. 1.One-to-one − When only one instance of an entity is associated with the relationship, it is marked as '1:1'. The following image reflects that only one instance of each entity should be associated with the relationship. It depicts one-to-one relationship. 2. One-to-many − When more than one instance of an entity is associated with a relationship, it is marked as '1:N'. The following image reflects that only one instance of entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts one-to-many relationship. 47
  • 48. Many-to-one − When more than one instance of entity is associated with the relationship, it is marked as 'N:1'. The following image reflects that more than one instance of an entity on the left and only one instance of an entity on the right can be associated with the relationship. It depicts many-to-one relationship. Many-to-many − The following image reflects that more than one instance of an entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts many-to-many relationship 48
  • 49. E-R diagram for library management system PCP,NIGDI, Mrs.S.S.Jogdand 49
  • 50. E-R diagram for bank management system 50