DBMS 2022 Summary
DBMS 2022 Summary
Creating a Table An entity set is a set of entities of the same type that share
the same properties. Example: set of all persons, companies, trees,
Create table student ( holidays
INSERT INTO student (First_name, Last_name, Id, Gender, State) Unary relationship set
Binary relationship set
VALUES (‘Abubakar’, ‘Ibrahim’, 102, ‘Male’, ’Kano’ ); Ternary relationship set
N-ary relationship set
Delete item from Database
DELETE from student Unary relationship set is a relationship set where only
WHERE gender = ’Male’ one entity set participates in a relationship set.
Example : One person is married to only one person
Note : The delete request can contain a nested select that references
the relation from which tuples are to be deleted. example
1|Page
DATABASE MANAGEMENT 2022 ENGR. ABUBAKAR IBRAHIM (07085817280)
Mapping Cardinalities
Express the number of entities to which another entity can
be associated via a relationship set.
Most useful in describing binary relationship sets.
For a binary relationship set the mapping cardinality must
be one of the following types:
One to one
One to many
Many to one
Many to many
One to one : An entity inA is associated with at most one 1. Entity: An entity may be any object, class, person or place. In
entity in B, and an entity in B is associated with at most one the ER diagram, an entity can be represented as rectangles. Consider
entity in A.
an organization as an example- manager, product, employee,
department etc. can be taken as an entity.
2. Attribute
Many to one : An entity in A is associated with at most
one entity in B. An entity in B, however, can be associated The attribute is used to describe the property of an entity. Eclipse is
with any number (zero or more) of entities in A. used to represent an attribute. For example, id, age, contact number,
name, etc. can be attributes of a student.
2|Page
DATABASE MANAGEMENT 2022 ENGR. ABUBAKAR IBRAHIM (07085817280)
superclass.For example, Faculty and Student entities can be 4) A University registrar’s office maintains data about
the following entities:
generalized and create a higher level entity Person.
(a) courses, including number, title, credits, syllabus, and
prerequisites;
Generalization. In specialization, one higher level entity can Constructan E-R diagram for the registrar’s office. Document
all assumptions that you make about the mapping
be broken down into two lower level entities.
constraints.
o Specialization is used to identify the subset of an entity set
5) Design a Generalization–specialization hierarchy for
that shares some distinguishing characteristics. a motor-vehicle sales company. The company sells
motorcycles, passenger cars, vans, and buses. Justify
o Normally, the superclass is defined first, the subclass and its
your placement of attributes at each level of the
related attributes are defined next, and relationship set are hierarchy. Explain why they should not be placed at
a higher or lower level.
then added.
3|Page
DATABASE MANAGEMENT 2022 ENGR. ABUBAKAR IBRAHIM (07085817280)
Example: Let's assume, a school can store the data of teachers and the
subjects they teach. In a school, a teacher can teach more than one subject.
For a library
1-NF Solution
To convert the given table into 2NF, we decompose it into two tables:
4|Page
DATABASE MANAGEMENT 2022 ENGR. ABUBAKAR IBRAHIM (07085817280)
o 3NF is used to reduce the data duplication. It is also used to ACID Properties in DBMS
achieve the data integrity.
DBMS is the management of data that should remain integrated when
o If there is no transitive dependency for non-prime attributes, any changes are done in it. It is because if the integrity of the data is
affected, whole data will get disturbed and corrupted. Therefore, to
then the relation must be in third normal form. maintain the integrity of the data, there are four properties described in
the database management system, which are known as the ACID
Transitive Dependency : Occurs when one non- properties.
key determines some other attribute, when ever
some indirect relationship happens to cause
functional dependency it is known as Transitive
Dependency.
5|Page
DATABASE MANAGEMENT 2022 ENGR. ABUBAKAR IBRAHIM (07085817280)
Deadlock Prevention
Deadlock prevention protocols ensure that the system will
never enter into a deadlock state. Some prevention
strategies:
Timeout-Based Schemes :
6|Page
DATABASE MANAGEMENT 2022 ENGR. ABUBAKAR IBRAHIM (07085817280)
References :
Deadlock Detection https://www.javatpoint.com
Wait for Graph : Silberschatz−Korth−Sudarshan
Database System Concepts, Fourth
o This is the suitable method for deadlock Edition
7|Page