PL / SQL : Code an application that permits the user to enter new fast food items
Question:
PL / SQL : Code an application that permits the user to enter new fast food items (copy_f_food_items). The policy of the company is that the food item number must be between 70 and 100. Code a block that only permits codes between 70 and 100 to be entered. Explicitly raise an exception if entry of any other code is attempted. Run the block 2 times using the data below. Note: In most instances in a real-world application, a restriction on the values entered into a column will be coded as a CHECK constraint.
Run 1: Food code 75, description Burger, price $3.55
Run 2: Food code 20, description Chicken, price $4.15 IMPORTANT:
Copy the f_food_items table to copy_f_food_items first!
Code the block using RAISE. When an exception is thrown, display the message 'Invalid food item code; only 70-100 permitted'. Display the entire window and then SELECT * FROM copy_f_food_items for each run.
Systems Analysis And Design
ISBN: 978-1119496489
7th Edition
Authors: Alan Dennis, Barbara Wixom, Roberta M. Roth