Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

HKCU Database System Worksheet

HKCU Database System Worksheet

HKCU Database System Worksheet

Description

Unformatted Attachment Preview

Database Systems
Questions 1:
Mark 50
HK apartment rental agency is new startup company which aims to rent apartments to his clients. The
want to keep a record of their rentals and client information for which they have an initial database system
shown below.
Table 1: HK Apartment Rental Agency
Client No.
CL01
Client
Name
Apartment
No.
Apartment
Address
AN-34
Star Building,
Prince
Edward,
Kowloon,
Alice
Chan
AN-203
AN-18
CL10
Rent End
Date
Total
Rent
Landlord
No.
Landlord
Name
10/1/22
2000
LN 0AB
Iven Ho,
10/1/22
12/2/22
10000
LN 94B
Tony
Lam
05/1/22
6/2/22
12000
LN 0C4
Eva Liu,
12/1/22
20/3/22
17000
LN 0DE
Jacky
Chan
05/2/22
31/3/22
40000
LN 0DE
Jacky
Chan
Bob Li
AN-51
CL11
Moon Building,
Nam Cheong,
Kowloon
City Building,
Central, HK
Island.
Rent
Start
Date
2/1/22
Tommy
Lau
AN-89
Shinning
Towers, Tung
Chung,
Lantau Island
Seaview
Towers, Lohas
Park, New
Territories
For the database system shown in Table 1, answer the following questions
1) Perform the normalization and convert the database system shown in Table 1 to 1NF. Make sure
you write the 1NF version of the database system in table form with complete information.
2) Write the relational database schema of the 1NF database system. In your opinion what should be
primary keys in 1NF? List the primary keys and support your answer with reason reasons
3) Highlight all dependencies in 1NF database system and show in the graphical form.
4) Define 2NF in normalization. Normalize the 1NF database system and convert it into 2NF version
of the database system. Make sure you write the 2NF version of the database system in table form.
Show all tables of database system in 2NF with complete information.
5) Define 3NF in normalization. Normalize the 2NF database system and convert it into 3NF version
of the database system. Make sure you write the 3NF version of the database system in table form.
Show all tables of the database system in 3NF with complete information.
Q1 Answers
Question 2:
Mark 30
Maxims wants to keep record for all ingredients in stock. To make a basic cake, they need eggs, sugar, flour,
and baking powder. For each basic cake, it needs 4 eggs, 3 cups of sugar, 2 cups of flour and 1 tablespoon
of baking powder. Each time a cake is produced, the QOH (Quantity on Hand) in the table CAKE and
INGREDIENTS must be updated. The sample database contents are shown in the following tables:
Table name: CAKE
Cake Type
Basic Cake
QOH
288
Table name: INGREDIENTS
Ingredients
Eggs
Sugar
Flour
Baking powder
Unit
QOH
829
647
549
322
Cup
Cup
Tablespoon
Assume that the database starts with the values in the given tables above. Define transaction log. Write
the transaction log for adding new basic cakes in the database, using template given below. The number
of basic cakes to be added is according to the following formula:
Number of basic cakes to be added is 23.
ID
TRX
PREV
NEXT
NUM
PTR
PTR
1
1A3
NULL
2
2
1A3
1
3
3
1A3
2
4
4
1A3
3
5
5
1A3
4
6
6
1A3
5
7
7
1A3
6
NULL
ROW
OPERATION
TABLE
START
**START
TRANSACTION
COMMIT
** END
TRANSACTION
ID
ATTRIBUTE
BEFORE
AFTER
VALUE
VALUE
Q2 Answers
Question 3:
Mark 20
Below are the two transactions for Database. When both execute concurrently, there will possibly be
problems.
1) Find TWO scenarios with different type of problems in transactions execution. For each of the
scenarios, state the name of the problem, draw the transactions with timeline and mark the
operations where the problem would occur.
(14 marks)
Transaction 1
Read(A)
A = A +10
Read(B)
B=A+B
Write(B)
A=B+1
Write(A)
Transaction 2
Sum = 0
Read(B)
Read(A)
Sum = Sum + A + B
B = Sum
Write(B)
Read(A)
A = Sum * 10
Write(A)
Figure 3a: Transactions in Database
Concurrency control with locking can facilitate isolation of data items used in concurrently executing
transactions and avoid the problem above. However, poorly designed of locking could introduce deadlock
issue. Below are the transactions with locking.
2) Draw ONE scenario of transactions with timeline which will hit the deadlock problem. Mark the
operations where the problem would occur.
(6 marks)
Transaction 1
XLock(A)
Read(A)
A = A +10
XLock(B)
Read(B)
B=A+B
Write(B)
A=B+1
Write(A)
Transaction 2
Sum = 0
XLock(B)
Read(B)
XLock(A)
Read(A)
Sum = Sum + A + B
B = Sum
Write(B)
Read(A)
A = Sum * 10
Write(A)
Q3 Answers

Purchase answer to see full
attachment
Explanation & Answer:

4 pages

User generated content is uploaded by users for the purposes of learning and should be used following our honor code & terms of service.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20