Create a pl-sql procedure to print out the reservation

Assignment Help Database Management System
Reference no: EM131305254

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

Reference no: EM131305254

Questions Cloud

Compare the pros and cons of buying a put option : Compare the pros and cons of buying a put option versus selling a stock if you are worried that the price of the stock might decline.
Who is a desencendant of the queenmother : CS-205 Declarative Programming Assignment. Translate the following questions into Prolog queries and try them out: Who is the mother of Beatrice? Who has a child (one or more)? Who is a desencendant of the Queenmother
What is the intrinsic value of the put option : What is the intrinsic value of the call option that expires in April and has a $95 strike price?- What is the intrinsic value of the put option that expires in January and has a $105 strike price?
Discuss about the cultural influence in business psychology : Discuss about the Cultural Influence in Business Psychology.Mark Jones, a Production Manager, has been transferred from the manufacturing plant in his hometown of Chicago to his company's overseas manufacturing plant in Osaka, Japan.
Create a pl-sql procedure to print out the reservation : 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 return..
What does a bullish approach mean : What does a "bullish approach" mean? Why does the data on options purchases indicate that traders were taking a bullish approach?
Market value of this long-term debt is approximately equal : For the most recent fiscal year, book value of long-term debt at Schlumberger was $10329 million. The market value of this long-term debt is approximately equal to its book value. Schlumberger’s share price currently is $47.2. What would Schlumberger..
Why do you feel work plays such a vital role in the life : Why do you feel work plays such a vital role in the life of an individual, regardless of monetary compensation?Do you believe that different cultures place different levels of value on work?What individual differences, if any, play a role in an emplo..
What must the credit suisse strategist have been expecting : What must the Credit Suisse strategist have been expecting would happen to Abercrombie & Fitch's stock for this strangle strategy to be profitable?

Reviews

len1305254

12/8/2016 3:46:58 AM

Please read the following bullets before you start. • There are 7 problems with 100 points in total. • If a clarification question is common to others, the instructor will post the answer as an announcement. So please check course announcement regularly. • For PL/SQL programs, just submit the statements themselves. There is no need to print out results or show screen shots.

Write a Review

Database Management System Questions & Answers

  Design a suitable database system

Design a suitable database system with a suitable web based front end, which should include the following details :The web based interface should hab=ve necessary forms and fields to update student attendence,marks ,faculty profile,faculty workshops ..

  Highest average mark

Write a program to calculate and store the average obtained by 20 pupils in 7 subjects. Output the pupil that made the highest average mark in addition to those pupils making 50 marks and over.

  Develop a demonstration prototype system

ISY103 - Database Management for Business Individual Project: Database Case Study. Using MySQL, you are required to develop a demonstration prototype system that handles hotel bookings and payments. Use MySQL to create a new database called HMS

  Build a database

Build a database and produce a query report that shows 10 fields as in Table iamge using Microsoft Access

  Distinguish between packet switching and circuit switching

Distinguish between packet switching and circuit switching: Give three advantages and three disadvantages of each one.

  Describe a minimum of three heuristics to optimize queries

Your supervisors and customers are very impressed with the database you have put together. Describe a minimum of three heuristics to optimize Queries.

  What needed for the database to run at a proficient level

I need a good description and explanation of any situation(s) where this type of situation hindered your project from successfully deploying and what needed to happen in order for the database to run at a proficient level?

  Multi-core mobile processor

Assume we have TINGEN, a multi-core mobile processor. As writing an application in assembly language for the certain device, we have two selections concerning code optimization.

  Design a set of 3nf tables for your database scenario

Draw an ER diagram for your database scenario. Design a set of 3NF tables for your database scenario.

  Identify the primary decisions a database administrator make

With the obvious pace of current technology development, data continues to grow daily. Imagine that you are a Database Administrator for a large organization. Identify the primary decisions a Database Administrator must make in order to manage such d..

  Discuss the relationship between colossal and core patterns

Discuss the relationship between colossal and core patterns. What is boosting? State why it may improve the accuracy of decision tree induction? Ensemble methods improve classification accuracy. How?

  Create a database for a home-budgeting application

The first part is to create a database and some tables which will be appropriate for a home-budgeting application. That portion of the assignment should be completed from the MySQL console command line.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd