Create a local variable that inherits the structure

Assignment Help Programming Languages
Reference no: EM13761387

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.

Reference no: EM13761387

Questions Cloud

What are the economic implications of action : Assume that the government imposed a price ceiling on gasoline in order to prevent prices from getting too high. What are the economic implications of action in the gasoline markets? Use graphs as needed and explain your answers thoroughly.
Develop and verify a back up plan to complete your work : In our discussion for this week you will develop and verify a back up plan to complete your work. Where will you go to get access to another computer to do your work when you lose power in your neighborhood
Explain how you would use the monetary and fiscal policy : Write a three- page research to explain how you would use the monetary and fiscal policy tools to jump start the economy.
Differences between white hat and gray hat hackers : Research the art and science of ethical hacking. Provide a plain English summary of your research in which you answer the following: What are the primary differences between white hat and gray hat hackers? Is it possible for hacking to be conducted ..
Create a local variable that inherits the structure : Create a local variable that inherits the structure of the i_car table (using %ROWTYPE attribute). Place each row returned into this variable.
Develop an organizational structure for the product : Develop an organizational structure for the product and create an operations plan
Describe at least three purposes of the budgetary process : 1. Describe at least three purposes of the budgetary process. 2. For a company's budget to have a positive effect on their employees, describe three guidelines for the budgeting process.
Advantages and disadvantages of using your proposed tool : You are the new network administrator for a small hospital in your local city. Discuss the advantages and disadvantages of using your proposed tool
Provide an example of a dmz : Your senior network architect suddenly left the company that you work for, and you are left alone with your manager and 3 help desk support staff who you are not too familiar with the network operation of the organization

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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