Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Please submit the CODE and OUTPUT for all programming questions. You will submit this assignment electronically in the ASSESSMENT area of the Study Desk.

In this assignment, you will use the CAR HIRE database. The CAR HIRE database including appropriate data will be made available on the USQ Oracle server. You can query these tables as if they are in your own schema but you are not permitted to insert or update data in these tables. The specification for the CAR HIRE database is as follows:

The table descriptions appear below, including the column names, data types and the meanings for values in the columns. Familiarise yourself with the tables and the data.

I_CAR

1286_CAR HIRE 1.png


I_CARGROUP

793_CAR HIRE 2.png


I_MODEL

305_CAR HIRE 3.png


I_CUSTOMER

1024_CAR HIRE 4.png


I_BOOKING

1674_CAR HIRE 5.png


Question 1

Write an anonymous block that places a substitution variable (&) into a local variable of type character. You should check the value entered in the local variable and output different messages depending on the value provided.
• If value is ‘A', output: ‘Please proceed to Level 1'
• If value is ‘B' or ‘C', output: ‘Please proceed to Level 2'
• If value is ‘D', output: ‘Please proceed to Level 3'
• In all other entries, output: ‘Invalid Entry'

Question 2

Create a host (or global) variable named G_NEWVALUE.
Write an anonymous block that declares two local variables: A1RATE and B2RATE. The data types of these two variables should be the same as the data type of the column rate_per_mile in i_cargroup table. Also declare a constant called SURCHARGE with value 5.
In your BEGIN section, write two SELECT queries to obtain value of the rate_per_mile column where car_group_name is ‘A1' and ‘B2' and assign the corresponding values to A1RATE and B2RATE variables. Now use the IF-THEN statement to compare the two variables and add the constant SURCHARGE to the smaller value. Assign the new sum to the variable G_NEWVALUE.
Using the PRINT command, output the value in the host variable (G_NEWVALUE) after the anonymous block has run.

Question 3

Write an anonymous block that meets the following specification:
1. Using an explicit cursor, retrieve each row from the i_car table.
2. Create a local variable that inherits the structure of the i_car table (using %ROWTYPE attribute). Place each row returned into this variable.
3. Using an implicit cursor, calculate the number of bookings that belong to each car.
4. Display the car registration, car group name, model name, cost and the number of bookings for each car.

Question 4

Write a PL/SQL that displays the maximum miles driven from the odometer reading for all the car bookings. Your program must use at least one explicit cursor and must NOT use any functions, for example SUM, MAX, COUNT, etc.
(Hint: miles driven from the odometer reading for each booking can be found by subtracting miles_out column from miles_in column, i.e. miles_in - miles_out)

MARKING CRITERIA
1. The code executes without error messages.
2. The code produces the required output.
3. The code addresses the specification and provides a solution to every element in the specification.
4. The code is well structured and, where applicable, adopts an optimal and sophisticated approach to PL/SQL.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9888673
  • Price:- $70

Priced at Now at $70, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Consider the following production function that is already

Consider the following production function that is already written in per worker terms: y = Akαh 1-α where h represents human capital per worker. Suppose we are given the following information: capital per worker in an e ...

Coa assignment task -q1 a the fibonacci numbers are the

COA Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of ...

To review stacksdirections write java code that prompts the

To review stacks Directions : Write Java code that prompts the user for a string and tells them if the grouping characters in that string are balanced. Grouping characters are ( and ), [ and ], and { and }. I got the bas ...

What are some skills individuals who work in the field of

What are some skills individuals who work in the field of cyber security need to prevent hacks in to a company's computers?

A professor collected data on the number of absences in an

A professor collected data on the number of absences in an introductory statistics class of 100 students over the course of a semester. The data are summarized below. Number of Absences 0 1 2 3 4 5 6 Number of Students 5 ...

Need references for information for the following dealing

Need references for information for the following dealing with CSMS (Consolidated Sales and Marketing System Project) Produce a narrative which describes the added error-handling pathways that includes: an overview of th ...

When a developer creates an app should they make it

When a developer creates an app, should they make it backwards compatible, so that the app can be handled by older versions of the operating system? Why or why not?

Discuss how today the internet has brought millions of

Discuss how today, the internet has brought millions of unsecured computer networks into communication with each other.

Question a student has a first name fname a last name lname

Question : A student has a first name (fname), a last name (lname), an identification number (id), a gender (male/female), a course name (cname) and the number of lectures (lcount) attended by the student. a. Define gend ...

Question suppose we have a disk with capacity 98304 gb if

Question : Suppose we have a disk with capacity 98.304 GB, if number of platters 16, an average of 300 sectors per track and 20,000 tracks per surface. Then calculate the number of bytes per sector.

  • 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