DBMS1
DBMS1
Data?
collection of information, statistical values, could be facts and
figures, just numbers and any type of record.
Eg., Details of your friend – like name, address, DOB, email i.d
etc.,
Difference between Data and Datum.
Data – plural
Datum - singular
DATABASE
Collection of related data.
Capability to share
DBMS - Action
Define
Construct
Manipulating
Security problems
Not every user of the database system should be able to access all
the data.
E.g. In a banking system payroll personnel need to see only that part of the
data base that has information about the various bank employees. They do not need
access to information about customer accounts.
Database systems offer solutions to all the above
problems
Difference between DBMS and File processing system
Data Abstraction:
A data model is used to hide storage details and
present the users with a conceptual view of the
database.
of database applications.
Advantages of Using the database
Controlling redundancy
Objects
Advantages of Using the database
of users.
Disadvantages
1. Database systems are complex, difficult, and
time-consuming to design
2. Substantial hardware and software start-up
costs
3. Damage to database affects virtually all
applications programs
4. Extensive conversion costs in moving form a
file-based system to a database system
5. Initial training required for all programmers
and users
When not to use a DBMS
For example
Employee entity may describe by
Name, Age, address, salary and job.
Attribute & Attribute Value
Attribute
Student
Attribute Value
Attribute Type
Atomic Attribute
Composite Attributes
Single-Valued
Multi Valued
Stored Attribute
Derived Attribute
Atomic Attribute
Atomic Attribute is an attribute that is not divisible.
Called Atomic or Simple Attributes.
Example
Student
Atomic Simple
Address
Tambol
Province
Composite District
Attribute? Atomic
Attribute
Single-Valued VS Multi Valued Attributes
Attribute
Age Degree
A : 24 Years A : B.Sc.
B : 27 Years B : B.Sc, M.Sc., Dr. Eng.
Attribute Value
Stored VS Derived Attributed
Stored Attribute
Derived Attribute: an attribute value
can be determined from another
attribute / related entity.
Example
Attribute
Derived Attribute
Attribute Value
Key Attribute
An attribute that whose values are distinct for each
individual entity in the entity set.
Unique
Not Null
Null Value
Example
Degree attribute applied only to a person with
collage degree.
Department
Project
Dependent
Entity Type, Entity Sets, Keys, Value Set
E2 R1
D1
E3
R2 D2
E4
D3
E5 R3
D4
E6
R4
E7
Entity E2
Entity E1
Relationship
1 to Many Relationship
E1
E2 R1
D1
E3
R2 D2
E4
D3
E5 R3
D4
E6
R4
E7
Entity D
Entity E
Relationship
Many to Many Relationship
E1
E2 R1
J1
E3
R2 J2
E4
J3
E5 R3
J4
E6
R4
E7
Entity J
Entity E
Relationship
Participation Constraints and Existence
Dependencies
Participation Constraints specified whether the
existence of an entity depends on its being related
to another entity via the relationship type.
It specifies the minimum number of relationship
instance that each entity can participate in, and is
sometimes called the minimum cardinality constraint.
Participation type
Partial
Total participation
(existence dependency)
Total participation
E1
E2 R1
D1
E3
R2 D2
E4
D3
E5 R3
D4
E6
R4
E7
Entity D
Entity E
Relationship
Partial participation
E1
E2 R1
D1
E3
R2 D2
E4
D3
E5 R3
D4
E6
R4
E7
Entity E Entity D
Relationship
Recursive Relationship
76
Cardinality Ratio
• Specify the number of relationship instances that an
entity can participate in
• 1:1 (each entity can only participate once)
• 1:N (one entity can participate once, the other can
participate many times)
• M:N (each entity can participate many times)
• WORKS_ON (EMPLOYEE:PROJECT) = M:N
• WORKS_FOR (EMPLOYEE:DEPT) = N:1
E-R Design Refined
79
Entity
Weak Entity
Relationship
Weak Entity
Attribute
Key Attribute
Composite Attribute
Derived Attribute
partial Total
E1 R E2
1 N
E1 R E2
Cardinality Ratio
84