Dbms 1
Dbms 1
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
4 5
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
6 7
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
10 11
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
12 13
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
16 17
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
18 19
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
PREPARED BY PREPARED BY
DBMS Structure
SHARIKA T R SHARIKA T R
Disadvantages of DBMS
• Cost of Hardware & Software
• Cost of Data Conversion
• Cost of Staff Training
• Appointing Technical Staff
• Database Damage
22 23
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
24 25
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
28 29
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
30 31
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
34 35
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Unstructured data
• data which is not organized in a predefined manner
or does not have a predefined data model,
• thus it is not a good fit for a mainstream relational
database
• there are alternative platforms for storing and
managing, it is increasingly prevalent in IT systems
and is used by organizations in a variety of business
intelligence and analytics applications.
• Example: Word, PDF, Text, Media logs.
36 37
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
40 41
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
42 43
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Database state
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
46 47
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
48 49
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Mappings
• In a DBMS based on the three-schema architecture, • The processes of transforming requests and
each user group refers only to its own external results between levels are called mappings.
schema.
• Hence, the DBMS must transform a request • These mappings may be time-consuming, so
specified on an external schema into a request some DBMSs—especially those that are meant to
against the conceptual schema, and then into a support small databases—do not support
request on the internal schema for processing over external views.
the stored database.
• a certain amount of mapping is necessary to
• If the request is a database retrieval, the data
extracted from the stored database must be transform requests between the conceptual and
reformatted to match the user’s external view. internal levels.
Downloaded from Ktunotes.in Downloaded from Ktunotes.in
50 51
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
52 53
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
54 55
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
DBMS Interfaces
• There are two main types of DMLs. • User-friendly interfaces provided by a DBMS
• High-level or nonprocedural DML can be used
on its own to specify complex database operations may include the following:
concisely. 1. Menu-Based Interfaces for Web Clients or
• Low-level or procedural DML must be Browsing.
embedded in a general-purpose programming
language. This type of DML typically retrieves 2. Forms-Based Interfaces.
individual records or objects from the database and 3. Graphical User Interfaces (GUI)
processes each separately. Therefore, it needs to use
programming language constructs, such as looping, 4. Natural Language Interfaces
to retrieve and process each record from a set of 5. Speech Input and Output
records. Low-level DMLs are also called record-at-a-
time DMLs 6. Interfaces for Parametric Users.
Downloaded from Ktunotes.in Downloaded from Ktunotes.in
56 57
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
ER Diagram
• It is not a technical method
• High level conceptual data model
ER MODEL • It is used for conceptual data design of database
applications
• Collection of entities and their properties called
attributes and relationship between them
• Diagrammatic representation and easy to
understand for non technical users
58 59
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
60 61
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Entity set
• The collection of same type of entities that is
their attributes are same is called entity set
• We can say that entity type is a superset of the
entity set as all the entities are included in the
entity type
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Attributes
• The properties of entity that basically describes it
• Attributes describes characteristics of entity
• Suppose we have a entity EMPLOYEE and its
attributes are ENO, ESAL, ENAME etc..
• Attributes have some set of allowed or permitted
values called Domain
• Attributes are represented by OVAL
• Each attribute of an entity set is associated with
domain that means the set of values that can be
assigned to that attribute for an entity
Downloaded from Ktunotes.in Downloaded from Ktunotes.in
64 65
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
66 67
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
• Composite Attribute
▫ Attributes that can be divided into smaller sub Single valued vs Multivalued Attributea
parts
▫ Example: Name attribute can be divided into • Single Valued
FirstName, MiddleName, LastName ▫ Attributes which are having single values
▫ Example: Age
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
70 71
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Complex Attribute
• Complex attribute is a combination of composite
and multi-valued attributes.
• Complex attributes are represented by { } and
composite attributes are represented by ( ).
• Example: Address_phone attribute will hold
both the address and phone_no of any person.
• Example: {(2-A, St-5, Sec-4, Bhilai), 2398124}
72 73
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
76 77
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
78 79
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Derived
Weak Entity attribute
Attribute Multivalued
Attribute
Downloaded from Ktunotes.in Downloaded from Ktunotes.in
82 83
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Composite Attribute
Constraints
• Relationship types usually have certain
constraints. Two main types of relationship
Relationship type constraints:
1. Mapping cardinalities
2. Participation constraints
Identifying Relationship
84 85
PREPARED BY PREPARED BY
• Binary Relationship
SHARIKA T R SHARIKA T R
Degree of a relationship
Employee Works Department
• It is the number of entity set which are in
participating in a relationship
▫ Unary relationship • Ternary Relationship
▫ Binary Relationship
Course
▫ Ternary Relationship
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
88 89
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Cardinality Ratio
• The cardinality ratio for a binary relationship • We express cardinality ratio by drawing
specifies the maximum number of relationship • directed line (→), signifying “one,” or an
instances to which an entity can take part in it
• undirected line (—), signifying “many,”
• It also specifies number of entities to which
other entity can be related by a relationship
• Types
▫ One-to-one (1:1)
▫ One-to-many (1: N)
▫ Many-to-one (N: 1)
▫ Many-to-many (M: N)
Downloaded from Ktunotes.in Downloaded from Ktunotes.in
90 91
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
One to One(1:1) 1 1
Male married Female
M4 F4
M5 F5
M6 F6
F7
Downloaded from Ktunotes.in Downloaded from Ktunotes.in
92 93
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
94 95
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
1 M
Department has Employees
d2 e2
d3 e3
d4 e4
d5 e5
e6
e7
Downloaded from Ktunotes.in Downloaded from Ktunotes.in
96 97
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
m3 p3
m4 p4
p5
p6
p7
Downloaded from Ktunotes.in Downloaded from Ktunotes.in
98 99
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
M Works 1
Employee Department
for
• In a many-to-one relationship a loan is
e1 associated with several customers via borrower.
d1
e2
d2
e3
d3
e4
d4
e5
e6
e7
Downloaded from Ktunotes.in Downloaded from Ktunotes.in
100 101
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Many to Many(M:N) M N
Teacher has Students
102 103
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Exercise
___ ___
Author writes Books
___ ___
Indian citizen has Pan card
___ ___
Indian citizen has Mobile number
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
106 107
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Total participation
• There are two types of participation constraints • every entity in the entity type participates in at
1. Total Participation least one relationship in the relationship type
▫ E.g. participation of loan in borrower is total every
2. Partial Participation
loan must have a customer associated to it via
borrower
• Represented by double lines
• Minimum and maximum cardinality
represented inside paranteses(m,n)
108 109
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
M (2,9)
Works 1 Partial participation
Employee Department
for
• Some entities may not participate in any
e1 relationship in the relationship type
d1 ▫ Example: participation of customer in borrower is
e2 partial
d2
e3 • Represented by single line
d3
e4
d4
e5
e6
e7
Downloaded from Ktunotes.in Downloaded from Ktunotes.in
110 111
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
112 113
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
114 115
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Identifying Relationship
• It links the strong and weak entity and is
represented by a double diamond sign.
• Let us see with an example to link both the
entities using Identifying Relationships:
118 119
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Relationship of degree 3
• In Ternary relationship three different Entities takes
part in a Relationship.
• Relationship Degree = 3
• For Example: Consider a Mobile manufacture company.
Three different entities involved:
▫ Mobile - Manufactured by company.
▫ Part - Mobile Part which company get from Supplier.
▫ Supplier - Supplier supplies Mobile parts to Company.
• Mobile, Part and Supplier will participate simultaneously
in a relationship. because of this fact when we consider
cardinality we need to consider it in the context of two
entities simultaneously relative to third entity.
Downloaded from Ktunotes.in Downloaded from Ktunotes.in
120 121
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
Example − Consider a Supplier S1 that supplies Example − Consider a Mobile M1 that has a
a Processor P1 to the company and the uses the Part P1 and it is being supplied by multiple
Processor P1 supplied by Supplier S1 in its Suppliers in that case the cardinality of Supplier
multiple Models in that case the cardinality of relative to Mobile and Part is M (many).
Mobile relative to Supplier and Part is N (many).
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
• Similarly, for a given instance of Supplier and an • Construct an E-R diagram for a car-insurance
instance for Mobile does the Supplier supply company whose customers own one or more cars
multiple Parts. each. Each car has associated with it zero to any
number of recorded accidents
Example − Consider a Supplier S1 supplying
parts for Mobile M1 like screen, Processor etc. in
that case the cardinality of Part relative to
Supplier and Mobile is P (many).
124 125
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
126 127
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
PREPARED BY PREPARED BY
SHARIKA T R SHARIKA T R
130
PREPARED BY
SHARIKA T R