DBMS Cat
DBMS Cat
DBMS Cat
ADM NO PHNE NO
AGE GUARDIAN
ASSIGN
STUDENT CLASS
ED
NAME D.O.B
CLASS
NAME
REGIST
FIRST NAME SECOND
ERS
NAME
CLUB
NAME
CLUB
CLUBID
CODE
b) With the aid of an example, distinguish between a composite attribute and a derived
attribute as used in ER diagrams. (5mks)
A composite attribute is made up of more than one simple attribute.
- For example, a student’s address will contain the house number, city, address and
street name.
A Derived attribute is an attribute that is not present in the whole database but they are
derived from another attribute
- Age can be derived from the date of birth
1
- Salary can also be derived from an employee
c) During a database maintenance session, it was discovered that the Data dictionary had
malfunctioned.
i. Explain two functions of this dictionary in a database (4mks)
A database dictionary is used to catalog and communicate the structure and content of
data and provides a meaningful descriptions for individually named data objects.
A database dictionary also provides a concise guide to understanding and using the data
in the database.
It defines number of entities in one entity which can be associated with number of entities and
other set via a relationship.
2
Customers has a name, address that consists of house number, area and city and
one or more phone numbers.
Customers have various types of accounts
Some customers also had taken different types of loans from these bank branches
Accounts has number, type and balance
One customer can have multiple accounts and loans
i. Identify four entities in the narrative (2mks)
a) Banks
b) Branch
c) Customer
d) Account
ii. Draw and Entity-Relationship Diagram to represent the information (8mks)
C BANK R BRANCH
BANK NAME
BRANCH NAME
R
LOAN TYPE
CUSTOMER
NUMBER
R
NAME
ADDRESS
ACCOUNT
3
Deadlock Prevention:
Deadlock prevention involves structuring the system in a way that makes it impossible for
deadlocks to occur. This can be achieved by using techniques such as: a. Resource Ordering:
Define a total ordering of resources and ensure that transactions always request resources in the
same order. This helps prevent the circular wait condition, a key factor in deadlock formation. b.
One-to-One Locking: Enforce a rule that a transaction can acquire only one lock at a time. By
ensuring exclusive access to a single resource, the possibility of circular wait is eliminated.
Strong Entities:
Strong entities are entities that exist independently and have their own unique identifier.
They have sufficient attributes to be uniquely identified in a database.
4
Weak Entities
Weak entities are entities that cannot exist or be uniquely identified without being associated
with another entity.
They depend on a strong entity, known as the identifying or owner entity, for their existence.
ii) Distinguish between read phase and write phase as used in concurrency control
phase validation in a database. (4mks)
Read Phase: During the read phase, a transaction reads data from the database without modifying
it. The primary objective of this phase is to determine the data values that the transaction requires
for its operations. The transaction examines the database and reads the values of the required
data items into its local workspace or transaction buffer. These read values are typically used for
subsequent computations or comparisons during the write phase.
Write Phase: The write phase occurs after the read phase and involves modifying the database
based on the results of the transaction's computations or comparisons. In this phase, the
transaction applies its modifications to the database, which may involve inserting, updating, or
deleting data records. The transaction's local workspace or transaction buffer is used to
temporarily hold the changes made during this phase.
3. The following is cardinality relationship that exists between pairs of entities in a
database. Use it to answer the questions that follows;
Pairs of entities Relationship
Customers and sales 1:N
Customers and products M:N
Customers and shops M:N
Sales and products M:N
Shops and sales 1:N
Shops and products M:N
Draw the entity relationship that exists between tables (7mks
5
SALES
CUSTOMERS
SHOPS
PRODUCTS
TELEPHONE
SHIPPED CAR RECEIVE GO- DOWN
S
CAR TYPE
DELIVER
DESTINATION
Y
DELIVERY DT
CLIENT CLIENT ID
TRANSPORT CLIENT
TYPE NAME
6