Define exception handlers in programming

Assignment Help PL-SQL Programming
Reference no: EM13930285

Part 1

Now that business is becoming strong and the movie stock is growing for More Movie Rentals, the manager wants to do more

inventory evaluations. One item of interest concerns any movie for which the company is holding $75 or more in value. The

manager wants to focus on these movies in regards to their revenue generation to ensure the stock level is warranted. To

make these stock queries more efficient, the application team decides that a column should be added to the MM_MOVIE table

named STK_FLAG that will hold a value '*' if stock is $75 or more. Otherwise the value should be NULL. Add the needed column

and create an anonymous block that contains a CURSOR FOR loop to accomplish the task. The company will run this program

monthly to update the STK_FLAG column before the inventory evaluations.

Make sure that you display the table structure of MM_MOVIE using DESC, and SELECT all data from this table before and after

you do this exercise to show the effect of your block.

Submit all code and Oracle responses. Before submitting, edit your document to remove erroneous attempts.

Part 2

Here is a block that retrieves the movie title and rental count based on a movie id provided via a host variable.

SET SERVEROUTPUT ON

VARIABLE g_movie_id NUMBER

BEGIN

:g_movie_id := 4;

END;

/

DECLARE

v_count NUMBER;

v_title mm_movie.movie_title%TYPE;

BEGIN

SELECT m.movie_title, COUNT(r.rental_id)

INTO v_title, v_count

FROM mm_movie m, mm_rental r

WHERE m.movie_id = r.movie_id

AND m.movie_id = :g_movie_id

GROUP BY m.movie_title;

DBMS_OUTPUT.PUT_LINE(v_title || ': ' || v_count);

END;

/

Add exception handlers for errors that you can and cannot anticipate. Test the block by running it with various values of the

host variable.


Attachment:- Lab 1a results.doc

Reference no: EM13930285

Questions Cloud

Basic research design issues : What are the basic research design issues? Describe them in some detail.
Calculate the trend-cycle and monthly seasonal indices : Use a classical multiplicative decomposition to calculate the trend-cycle and monthly seasonal indices. Do the results support the graphical interpretation from part (a)?
Summarize basic principles of solution-focused brief therapy : Summarize the basic principles of Solution-Focused Brief Therapy (SFBT). Be sure you describe the main techniques used in this method of family therapy. Does this model of family therapy fit with the other models you have studied?
Unconventional monetary policy : Explain why some central banks have decided to undertake unconventional monetary policy in the form of quantitative easing.
Define exception handlers in programming : Add exception handlers for errors that you can and cannot anticipate. Test the block by running it with various values of the host variable.
Does the homogeneous box of mass m slip or tip first : The magnitude of force P is slowly increased. Does the homogeneous box of mass m slip or tip first? State the value of P which would cause each occur- rence. Neglect any effect of the size of the small feet.
Estimate the seasonal indices and the trend : Use a classical multiplicative decomposition to estimate the seasonal indices and the trend. Comment on these results and their implications for forecasting.
Immediate policy decision : Before turning to its immediate policy decision, the Committee discussed financial market developments; the international economy; money, credit, demand and output; and supply, costs and prices.
Examine the major design flaws and features of the airline : Describe the key factors that constitute a user friendly check-in experience. Examine the major design flaws and features of the airline you researched. Recommend one (1) feature you would like to add or eliminate

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

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