Create a procedure MC_CREATE_RANDOM_MENU that produces a random full-day menu, according to the following specification: Parameters:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a procedure MC_CREATE_RANDOM_MENU that produces a random full-day menu, according to the following specification: Parameters: OP_DAY_NUMBER Specifications: O Remove any existing data from tables MC_90_DAYS_MENU and MC_90_DAYS_MENU_ITEM corresponding to the same "Day Number" a. Then, create a random full-day menu recommendation for that specific day, adding menu items into MC_90_DAYS_MENU_ITEM table, according to the following rules for each meal type: • Breakfast: O Lunch: o o one random item from "Breakfast" category + one random item from "Coffee & Tea" category one random item from "Salads" category + one random item from "Beef & Pork" OR "Chicken & Fish" categories (randomly choose one from the two categories above) + one random item from "Beverages" category + one random item from "Desserts" category (desserts must be included only in random 50% of the daily menus) Afternoon snack (randomly choose between A or B combinations below): 00 (A) o one random item from "Smoothies & Shakes" category OR (B) o o Dinner: o one random item from "Coffee & Tea" category + one random item from "Snacks & Sides" category one random item from "Beef & Pork" or "Chicken & Fish" categories (randomly choose one from the two categories above) + O one random item from "Beverages" category + o one random item from "Desserts" or "Coffee & Tea" categories (randomly choose one from the two categories above) Procedure Code (20 points) Procedure MC _CREATE_RANDOM_MENU Code Trigger Code (20 points) CREATE OR REPLACE PROCEDURE MC_CREATE_RANDOM_MENU * Test your procedure and make sure it works before moving to the next task 4.2. Create a trigger MC_90_DAYS_MENU_ITEM_TRG that cumulatively updates all the SUM_ columns in the MC_90_DAYS_MENU table, after each record is created in the MC_90_DAYS_MENU_ITEM table. How-to: a. To calculate the final "SUM_SODIUM_DAILY_PERC" for Recommendation DAY_NUMBER = 1, you must SUM the "SODIUM_PERC_DAILY_VALUE" from each menu item included in that daily menu. However, think about how to design that implementation using a FOR EACH ROW trigger (AFTER INSERT) * You DO NOT need to worry about DELETE and UPDATE transaction in this trigger b. All SUM_*_DAILY_PERC column in "MC_90_DAYS_MENU" table have a corresponding column in "MC_ MENU_ITEM" table named as *_ PERC_DAILY_VALUE. Trigger MC_90_DAYS_MENU_ITEM_TRG Code CREATE OR REPLACE TRIGGER MC_90_DAYS_MENU_ITEM_TRG *** MC_MENU_CATEGORY CATEGORY_ID integer CATEGORY_NAME varchar2(30) MC_MENU_ITEM MENU ITEM_ID CATEGORY_ID MENU ITEM SERVING_SIZE_OZ SERVING SIZE_G SERVING_SIZE_FL_OZ SERVING_SIZE_ML CALORIES CALORIES FROM_FAT TOTAL FAT TOTAL FAT_PERC_DAILY_VALUE SODIUM CHOLESTEROL_PERC_DAILY_VALUE SATURATED FAT number(6,1) SATURATED FAT_PERC_DAILY VALUE number(6,1) TRANS FAT number(6,1) CHOLESTEROL SODIUM_PERC_DAILY VALUE CARBOHYDRATES CARBOHYDRATES_PERC_DAILY_VALUE DIETARY FIBER DIETARY FIBER PERC_DAILY_VALUE SUGARS PROTEIN PK VITAMIN_A_PERC_DAILY VALUE VITAMIN C PERC DAILY VALUE CALCIUM PERC_DAILY VALUE IRON_PERC_DAILY_VALUE integer integer varchar2(255) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) PK FK MC_90_DAYS MENU DAY NUMBER SUM_FAT DAILY PERC SUM SATURATED FAT_DAILY_PERC SUM CHOLESTEROL_DAILY_PERC SUM SODIUM_DAILY_PERC SUM CARBOHYDRATES_DAILY_PERC SUM DIETARY FIBER_DAILY_PERC SUM VITAMIN A DAILY PERC SUM VITAMIN_C_DAILY_PERC SUM_CALCIUM_DAILY_PERC SUM_IRON_DAILY_PERC MC_90_DAYS_MENU_ITEM DAY NUMBER MEAL_TYPE_ID MENU_ITEM_ID integer number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N PK integer PK FK integer PK FK integer PK FK MC_90_DAYS MEAL_TYPE MEAL_TYPE_ID integer MEAL_TYPE_NAME varchar2(30) PK Vertabelo Create a procedure MC_CREATE_RANDOM_MENU that produces a random full-day menu, according to the following specification: Parameters: OP_DAY_NUMBER Specifications: O Remove any existing data from tables MC_90_DAYS_MENU and MC_90_DAYS_MENU_ITEM corresponding to the same "Day Number" a. Then, create a random full-day menu recommendation for that specific day, adding menu items into MC_90_DAYS_MENU_ITEM table, according to the following rules for each meal type: • Breakfast: O Lunch: o o one random item from "Breakfast" category + one random item from "Coffee & Tea" category one random item from "Salads" category + one random item from "Beef & Pork" OR "Chicken & Fish" categories (randomly choose one from the two categories above) + one random item from "Beverages" category + one random item from "Desserts" category (desserts must be included only in random 50% of the daily menus) Afternoon snack (randomly choose between A or B combinations below): 00 (A) o one random item from "Smoothies & Shakes" category OR (B) o o Dinner: o one random item from "Coffee & Tea" category + one random item from "Snacks & Sides" category one random item from "Beef & Pork" or "Chicken & Fish" categories (randomly choose one from the two categories above) + O one random item from "Beverages" category + o one random item from "Desserts" or "Coffee & Tea" categories (randomly choose one from the two categories above) Procedure Code (20 points) Procedure MC _CREATE_RANDOM_MENU Code Trigger Code (20 points) CREATE OR REPLACE PROCEDURE MC_CREATE_RANDOM_MENU * Test your procedure and make sure it works before moving to the next task 4.2. Create a trigger MC_90_DAYS_MENU_ITEM_TRG that cumulatively updates all the SUM_ columns in the MC_90_DAYS_MENU table, after each record is created in the MC_90_DAYS_MENU_ITEM table. How-to: a. To calculate the final "SUM_SODIUM_DAILY_PERC" for Recommendation DAY_NUMBER = 1, you must SUM the "SODIUM_PERC_DAILY_VALUE" from each menu item included in that daily menu. However, think about how to design that implementation using a FOR EACH ROW trigger (AFTER INSERT) * You DO NOT need to worry about DELETE and UPDATE transaction in this trigger b. All SUM_*_DAILY_PERC column in "MC_90_DAYS_MENU" table have a corresponding column in "MC_ MENU_ITEM" table named as *_ PERC_DAILY_VALUE. Trigger MC_90_DAYS_MENU_ITEM_TRG Code CREATE OR REPLACE TRIGGER MC_90_DAYS_MENU_ITEM_TRG *** MC_MENU_CATEGORY CATEGORY_ID integer CATEGORY_NAME varchar2(30) MC_MENU_ITEM MENU ITEM_ID CATEGORY_ID MENU ITEM SERVING_SIZE_OZ SERVING SIZE_G SERVING_SIZE_FL_OZ SERVING_SIZE_ML CALORIES CALORIES FROM_FAT TOTAL FAT TOTAL FAT_PERC_DAILY_VALUE SODIUM CHOLESTEROL_PERC_DAILY_VALUE SATURATED FAT number(6,1) SATURATED FAT_PERC_DAILY VALUE number(6,1) TRANS FAT number(6,1) CHOLESTEROL SODIUM_PERC_DAILY VALUE CARBOHYDRATES CARBOHYDRATES_PERC_DAILY_VALUE DIETARY FIBER DIETARY FIBER PERC_DAILY_VALUE SUGARS PROTEIN PK VITAMIN_A_PERC_DAILY VALUE VITAMIN C PERC DAILY VALUE CALCIUM PERC_DAILY VALUE IRON_PERC_DAILY_VALUE integer integer varchar2(255) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) number(6,1) PK FK MC_90_DAYS MENU DAY NUMBER SUM_FAT DAILY PERC SUM SATURATED FAT_DAILY_PERC SUM CHOLESTEROL_DAILY_PERC SUM SODIUM_DAILY_PERC SUM CARBOHYDRATES_DAILY_PERC SUM DIETARY FIBER_DAILY_PERC SUM VITAMIN A DAILY PERC SUM VITAMIN_C_DAILY_PERC SUM_CALCIUM_DAILY_PERC SUM_IRON_DAILY_PERC MC_90_DAYS_MENU_ITEM DAY NUMBER MEAL_TYPE_ID MENU_ITEM_ID integer number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N number(6,1) N PK integer PK FK integer PK FK integer PK FK MC_90_DAYS MEAL_TYPE MEAL_TYPE_ID integer MEAL_TYPE_NAME varchar2(30) PK Vertabelo
Expert Answer:
Related Book For
Operations Management Creating Value Along the Supply Chain
ISBN: 978-0470525906
7th Edition
Authors: Roberta S. Russell, Bernard W. Taylor
Posted Date:
Students also viewed these databases questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
1. Based on the information provided in the case below, what is the key strategic goal for Tim Hortons as of August 2014? It would be a year of dramatic change for Tim Hortons Inc. On August 26,...
-
Your examination of the records of Wilson Ltd, which was established on 1 March 2015, reveals that the accountant debited the Land, Buildings and Equipment account with the following items (ignore...
-
This is the same problem as Problem 6-14, but assuming the use of the complete equity method.) On January 1, 2013, Perry Company purchased 80% of Selby Company for $960,000. At that time Selby had...
-
Have a table that will show the equivalent effective interest rates to some nominal interest rates with various compounding rates. Put the nominal interest rates of 2%, 3%, 4%, 5%, 6%, 7%, 8%, 9%,...
-
The field of ontology studies different views of reality. Why are different ontological viewpoints important when determining the volume of information that needs to be produced by an ecological...
-
Model a parabolic GRIN fiber by the equivalent multiple-step approximation. Let n1=1.5, =0.01. Divide the radius into 10 equal parts. Consider a ray crossing the fiber axis at 5o with respect to that...
-
FarmFresh Grocery is considering building a new store in Cambridge. It estimates the cost of the project will be $25 million for construction at the start, but the store is expected to yield profits...
-
Knowing that P = 210 N, replace the three couples with a single equivalent couple, specifying its magnitude and the direction of its axis.
-
When Charlotte arrived in the emergency department, what acidbase disorder did she have? What was its cause? Why was her HCO 3 concentration decreased? Was her HCO 3 concentration decreased to an...
-
What is the most important or interesting fact. Write a focus sentence identifying that newsworthy angle: 1. The New England Journal of Medicine released a study today. The study say people who...
-
The interest for great X is given by QXd = 6,000 - (1/2)PX - PY + 9PZ + (1/10)M Examination shows that the costs of related merchandise are given by Py = $6,500 and Pz = $100, while the normal pay of...
-
Captain Fresh is planning to buy vehicles for the transportation of materials from procurement source to demand locations. They are thinking to reduce costs by using these vehicles rather than...
-
What are the key steps in the initiation and progression of apoptosis, and how do defects in these pathways contribute to cancer development ?
-
1. Calculate how long it would take your current personal or family savings to double at the current interest rate you are being offered by your bank. What will it take for you or your family to...
-
Consider three charges arranged in a triangle as shown in the figure: Q = 36 C h = 4 cm d = 3 cm Q2 = Q 194.4 J = d 0 d h Q = Q How much work is done by you to assemble these charges from...
-
Write each fraction as a percent. 7 50
-
The Konishi Electronics Company manufactures computer microchips. A particular job that has been under analysis as part of a quality-improvement program was the subject of a time study. The time...
-
a. Formulate and solve a linear programming model for Julia that will help you advise her if she should lease the booth. b. If Julia can borrow some more money from a friend before the first game to...
-
The three most important quality attributes at Mikes Super Service fast-food restaurant are considered to be good food, fast service, and a clean environment. The restaurant manager uses a...
-
a. Define an attribute of interest. b. What evidence should exist for attributes?
-
a. Indicate the types of statistical sampling techniques that may be used in auditing. b. Explain the essential differences between the techniques.
-
a. State the steps in a sampling plan for tests of controls. b. Identify the phases of an audit to which each step applies.
Study smarter with the SolutionInn App