1. Homepage
  2. Writing
  3. COMP643 Advanced Database Management Assignment 2: Transaction Management and Concurrency Control
This question has been solved

COMP643 Advanced Database Management Assignment 2: Transaction Management and Concurrency Control

Order Now
Lincoln UniversityCOMP643Advanced Database ManagementTransaction ManagementConcurrency ControlDatabase Performance TuningQuery OptimisationDatabase Security

COMP643 Advanced Database Management Assignment 2 Assignment Writing Service

Work not received by the due time incurs an immediate penalty of up to 25% of the marks available. No work will be accepted after Sunday 26th May 2024 5:00 p.m. Assignment Writing Service

via COMP643 on LEARN Assignment Writing Service

Part 1 Transaction Management and Concurrency Control (60 points) Assignment Writing Service

Agri Markets sell products to customers. The relational diagram in Figure 1 represents the main entities for Agri’s database. Assignment Writing Service

Figure 1- The Agri Markets Entity Relationship Diagram (ERD) Assignment Writing Service

Note the following important characteristics: Assignment Writing Service

A customer may make many purchases, each one represented by an invoice.
o The cus_balance is updated with each credit purchase or payment and represents Assignment Writing Service

the amount the customer owes.
o The cus_balance is increased (+) with every credit purchased and decreased (-) with Assignment Writing Service

every customer payment.
o The date of last purchase (cus_datelstpur) is updated with each new purchase made Assignment Writing Service

by the customer.
o The date of the last payment (cus_datelstpmt) is updated with each payment made Assignment Writing Service

by the customer. Assignment Writing Service

An invoice represents a set of products purchased by a customer.
o An Invoice can have many invoice lines, one for each product purchased.
o The inv_total represents the total cost of the invoice including taxes.
o The inv_terms can be “30”, “60”, or “90” (representing the number of days of credit) Assignment Writing Service

or “cash” or “cheque” or “cc”.
o Theinv_statuscanbe“open”,“paid”or“cancel”. Assignment Writing Service

A product’s quantity on hand (p_qtyoh) is updated (decreased) with each product sale. A customer may make many payments. The payment type (pmt_type) can be one of the following: Assignment Writing Service

o cash” for cash payments.
o cheque” for cheque payments. o cc” for credit card payments. Assignment Writing Service

The payment details (pmt_details) are used to record data about check or credit card payments. Assignment Writing Service

o The bank, account number, and cheque number for cheque payments.
o The issuer, credit card number, and expiration date for credit card payments. Assignment Writing Service

Not all entities are represented in this example. Use only the attributes indicated.
Using this database, write the SQL code to represent each of the following transactions. Use
Assignment Writing Service

BEGIN TRANSACTION to group the SQL statements in logical transactions. (10 points) Assignment Writing Service

  1. On 20 Apr 2024, customer 10010 makes a credit purchase (60 days) of two units of product 23109-HB with a unit price of $9.95 and one unit of product WR3-TT3 with a unit price of $119.95. The tax rate is 10%. The invoice number is 20001, and this invoice has two product lines. Assignment Writing Service

  2. On 5 May 2024, customer 10010 makes a payment of $100 in cash. The payment ID is 5001. Assignment Writing Service

Create a simple transaction log (using the format shown in Lecture 9) to represent the actions and transactions in Q1a. (10 points) Assignment Writing Service

Using the two-phase locking protocol, create a chronological list of locking, unlocking and data manipulation activities that would occur during the complete processing of the transaction described in Q1a. (10 points) Assignment Writing Service

For the following schedule, assume that the shared locks are requested immediately before each read operation, and exclusive locks are requested before every write operation. Unlocks occur immediately after the COMMIT statement. Assignment Writing Service

  1. Add lock and unlock requests (using shared/exclusive locks) and explain why this schedule will cause a deadlock. You will need to rewrite the schedule to show the lock and unlock requests. (10 points) Assignment Writing Service

  2. Assume that the timestamp for transaction T(i) is i, explain how this deadlock will be handled using wait/die and wound/wait schemes. (10 points) Assignment Writing Service

Q5. Given the concurrent transactions shown in Figure 2. At time 9, a crash occurred. Assignment Writing Service

Figure 2- Timeline of Concurrent Transactions Assignment Writing Service

  1. Describe in detail the database recovery process using the deferred-write technique for each transaction (5 points). Assignment Writing Service

  2. Describe in detail the database recovery process using the write-through technique for each transaction (5 points). Assignment Writing Service

Part 2 Database Performance Tuning and Query Optimisation (40 points) Assignment Writing Service

The following relational database schema is used to keep track of customer orders for roses at Lincoln Rose Farm: Assignment Writing Service

Customer (cust_num, cust_name, cust_city, cust_balance) Orders (order_num, cust_num, order_date, order_total) Orderline (line_num, order_num, prod_num, line_qty, line_total) Product (prod_num, prod_desc, prod_price, prod_qoh) Assignment Writing Service

The following SQL query is used to select all customers from Christchurch with a balance greater than 0 who have ordered “Ausblush” rose. Assignment Writing Service

SELECT cust_name
FROM (((customer
INNER JOIN orders on customer.cust_num = orders.cust_num) inner join orderline on orders.order_num = orderline.order_num) inner join product on orderline.prod_num = product.prod_num) where product.prod_desc = "Ausblush"
and customer.cust_city = "Christchurch"
and customer.cust_balance > 0.00;
Assignment Writing Service

Assume: Assignment Writing Service

  1. Q1.  Create two alternative access plans and show their respective I/O costs using the example table shown in Week 10 Lecture. (20 points) Assignment Writing Service

  2. Q2.  You have been asked to optimise the performance of the query. Assignment Writing Service

    1. a)  Identify and describe what indexes should be created and why? (10 points) Assignment Writing Service

    2. b)  Revise your access plan and the I/O cost for the selected plan from Q1 assuming the indexes you have identified are applied. (10 points) Assignment Writing Service

Assignment Writing Service

Part 3 Database Security (20 points) Assignment Writing Service

Q1. In Part 2, the database schema is used to process orders for roses. Orders are handled by the sales office. There are currently five staff in this office. Carol, the supervisor, needs to be able to see and update everything. Lim, Jane, and Billy do most of the routine work. They can add, update, and delete orders. They can view existing customers, but they cannot create new customers. Mina is a temporary staff member. She can process orders (add, update, and delete). For customer records, she is only allowed to view the cust_num and cust_name. Large orders above $1000 can only be handled by Carol and Billy. Assignment Writing Service

  1. What privileges should be granted to Carol with respect to the four tables? Explain your answer. (6 points) Assignment Writing Service

  2. List the privileges should be granted to Lim, Jane, and Billy. (4 points) Assignment Writing Service

  3. What privileges should be granted to Mina? (2 points) Assignment Writing Service

  4. What additional privileges do you need to grant Carol and Billy so that only these two can handle large orders above $1000. How do you ensure that the rest of the staff are not able to handle large orders? (5 points) Assignment Writing Service

  5. What steps do you need to take to ensure that the privileges are set correctly? (3 points) Assignment Writing Service

联系辅导老师!
私密保护
WeChat 微信
Lincoln University代写,COMP643代写,Advanced Database Management代写,Transaction Management代写,Concurrency Control代写,Database Performance Tuning代写,Query Optimisation代写,Database Security代写,Lincoln University代编,COMP643代编,Advanced Database Management代编,Transaction Management代编,Concurrency Control代编,Database Performance Tuning代编,Query Optimisation代编,Database Security代编,Lincoln University代考,COMP643代考,Advanced Database Management代考,Transaction Management代考,Concurrency Control代考,Database Performance Tuning代考,Query Optimisation代考,Database Security代考,Lincoln University代做,COMP643代做,Advanced Database Management代做,Transaction Management代做,Concurrency Control代做,Database Performance Tuning代做,Query Optimisation代做,Database Security代做,Lincoln Universityhelp,COMP643help,Advanced Database Managementhelp,Transaction Managementhelp,Concurrency Controlhelp,Database Performance Tuninghelp,Query Optimisationhelp,Database Securityhelp,Lincoln University作业代写,COMP643作业代写,Advanced Database Management作业代写,Transaction Management作业代写,Concurrency Control作业代写,Database Performance Tuning作业代写,Query Optimisation作业代写,Database Security作业代写,Lincoln University编程代写,COMP643编程代写,Advanced Database Management编程代写,Transaction Management编程代写,Concurrency Control编程代写,Database Performance Tuning编程代写,Query Optimisation编程代写,Database Security编程代写,Lincoln University作业答案,COMP643作业答案,Advanced Database Management作业答案,Transaction Management作业答案,Concurrency Control作业答案,Database Performance Tuning作业答案,Query Optimisation作业答案,Database Security作业答案,