Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

Problem 1: Please create a PL/SQL procedure to print out the reservation ID, checkin date, and checkout date of reservations made by a guest. The input parameters is the name of the guest. There is no output parameter.

Problem 2: Please write a PL/SQL function that given a reservation ID, returns the name of guest who made that reservation. If there is no such reservation in the database, return null. Please call this function with input reservation ID 1, and print out the returned value. You need to print No such reservation if the returned value is null.

Problem 3: Please answer questions a and b on RAID levels.

a) Suppose you are given 8 data blocks, 4 parity blocks, and 3 disks in RAID level 5. Please fill in data blocks in the figure below. You can use 1, 2, ... to represent data blocks and P1, P2, ... to represent parity blocks.

b) Please decide for each of the following applications, which RAID level (level 0, 10, or 5) may be the most appropriate. Please also briefly explain the reason for your answers.

i. An online video editing system. The system allows thousands of customers to upload their videos and use tools to edit uploaded videos. Customers will download the final version to their local storage.

ii. A flight control system that keeps track of planes near an airport. The positions of planes need to be constantly updated.

iii. A data warehouse for a big retailer. The retailer will use the data warehouse to analyze sales. Data is updated once a day during midnight.

Problem 4:

Please specify for each of the following SQL query, what indexes you want to create to speed up the SQL query.
- These queries use the database created on page 2. You can assume the tables have many rows.
- You need to specify the table and column you want to index. You don't need to write create index statements.
- Please also briefly explain why you select this index. Your grade depends on both the index and explanation.

Query 1.

select price
from room_rate
where rid = 123 and startdate <= date '2016-11-15' and enddate > date '2016-11-15';

Query 2.
select count(*)
from reservation r, guest g
where g.gid = r.gid and g.gname = 'John';

Query 3.
select gname, count(*)
from reservation r, guest g
where r.gid = g.gid
group by gname

Query 4.
select * from guest
where gname like '%James%';

Problem 5:

Below is the schedule for two transactions T1 and T2. Please briefly explain which transactions satisfy two-phase locking protocol and which does not. Your grade depends on both your answer and explanation. Each line is an operation starting with the transaction the operation belongs to. Lock-X(o) means request an exclusive lock on o. Lock-S(o) means request a shared lock on o. Unlock(o) means release the lock it holds on o.

T1

T2

Lock-X(A)

 

Read(A)

 

A := A - 50

 

Write(A)

 

Lock-X(B)

 

Read(B)

 

B : = B + 50

 

Write(B)

 

Unlock(A)

 

Unlock(B)

 

 

Lock-S(A)

 

Read(A)

 

Unlock(A)

 

Lock-S(B)

 

Read(B)

 

Unlock(B)

Problem 6.

Please briefly explain whether the following schedule has a deadlock. Your grade depends on both your answer and explanation. T1, T2, and T3 are 3 transactions. A, B, and C are 3 database rows. Lock-X means requesting an exclusive lock, Lock-S means requesting a shared lock. If you draw a wait-for graph, you will get partial credits even if your answer is wrong.

T1

T2

T3

Lock-X(C)

 

 

Write(C)

 

 

 

Lock-X(B)

 

 

Write(B)

 

 

 

Lock-S(A)

 

 

Read(A)

 

 

Lock-S(B)

 

Lock-S(C)

 

Lock-S(A)

 

 

Problem 7: For each of the following statements, decide whether it is true or false. Please use a sentence or two to explain why. Your grade depends both on your answer and explanation. [15 points, 3 points per question]

1. Given the parameters for the following disks, disk 2 is the best.
Disk 1: seek time 5 milliseconds, 5400 rpm
Disk 2: seek time 4 milliseconds, 10000 rpm
Disk 3: seek time 4 milliseconds, 7200 rpm

2. To check whether an index is used to answer a SQL query, you can simply run the same query twice, the first time before the creation of the index and the second time after creation of the index and check whether the second execution is faster than the first one.

3. Query optimization is done manually by DBA because DBA knows how to execute a SQL statement efficiently.

4. Two-Phase-Locking protocol not only ensures that concurrent execution of multiple transactions always gives correct result, but also prevents deadlock.

5. Once a transaction gets rolled back, it cannot be committed.

Attachment:- Database used in the EXAM.rar

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M92059888
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in DBMS

Sqlquery 1 how many products have standard price less than

SQL Query 1. How many products have standard price less than 1000? Query 2: Display all attributes for products made of "Cherry" from Product table w/o referring to column names. Query 3: Display all product names having ...

Question 1 a- consider that you are asked to design an

Question: 1. (a)- Consider that you are asked to design an entity relationship diagram based on the below scenario: A university consists of a number of departments (id, d_name) and each department offers some courses. A ...

Database and information retrieval assignment - data

Database and Information Retrieval Assignment - Data Privacy Essay Task - Write an essay (aim for 750 words) that addresses issues associated with data proivacy. Use the Australian Privacy Principles - discussed in class ...

Question 1 describe 1nf 2nf 3nf2 explain why 4nf is a

Question: 1: Describe 1NF, 2NF, 3NF. 2: Explain why 4NF is a normal form more desirable than BCNF. The response must be typed, single spaced, must be in times new roman font (size 12) and must follow the APA format.

Assignmenta restaurant is designing a database to keep

Assignment A restaurant is designing a database to keep track of customer services. A customer is defined as a customer ID, name, address and a telephone number. Customers are served by employees. Each employee is define ...

Database design and development assignment -assessment task

Database Design and Development Assignment - Assessment task - 1. Normalization a) Map the ERD, from the sample solution, into a set of relations in at least Third Normal Form (3NF). You must ensure that your relations m ...

You are responsible for keeping track of meal expenses for

You are responsible for keeping track of meal expenses for ten employees while at a business lunch to which your employer has invited you to attend. Write an algorithm that inputs the lunch costs for each the ten employe ...

Sqlwrite a select statement that returns three columns from

SQL Write a SELECT statement that returns three columns from the Vendors table: VendorContactFName, VendorContactLName, and VendorName. Sort the result set by last name, then by first name.

Your taskyou have been commissioned to develop a database

Your task You have been commissioned to develop a database system that is capable of keeping records for FU's table tennis matches from now on. The database needs to keep a record of: - All team information, including pl ...

Need an expert in the fields of system design to handle

Need an expert in the fields of system design to handle this project This is a system analysis and design project, not a research project. Refer to the list of deliverables in the instructions in the assignment to make s ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As