Query Description 1. Change to use the database airline 1. Create stored procedure payDeposit to do...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Query Description 1. Change to use the database airline 1. Create stored procedure payDeposit to do the following a. Set the delimiter to $$ b. Parameter list includes 3 i. IN employeeNum INT ii. INOUT deposit VARCHAR(4000) c. Declare the following variables i. v_finished integer DEFAULT 0 ii. v_lines varchar(100) DEFAULT" iii. v_empFirst varchar(100) DEFAULT"" iv. v_empLast varchar(100) DEFAULT"" v. v_empAddress varchar(100) DEFAULT vi. v_empCity varchar(100) DEFAULT"""; vii. v_empState varchar(100) DEFAULT"" viii. v_empZip varchar(100) DEFAULT"" ix. v tHours int DEFAULT 0 X. v_pHourly decimal(5,2) DEFAULT 0.0 xi. v overtime INT DEFAULT 0 xii. v_count integer DEFAULT 0 xiii. v_deposit decimal(8,2) DEFAULT 0.0 "" d. Declare cursor employee_cursor for the following join query i. Select 1. firstName from table employee 2. lastName from table employee 3. address from table employee 4. city from table cityState 5. state from table cityState 6. zipCode from table cityState 7. Sum columns sun, mon, tues, wed, thurs, fri, and sat from table timesheet as hours 8. hourly from table position ii. Where column emploveeld in table timesheet equals the value in e. ii. Where column employeeld in table timesheet equals the value in parameter employee Num Declare continue exception handler for not found set variable v_finished equal to 1 f. Open cursor employee_cursor g. Loop through the employee_cursor, using loop label get_employee i. Fetch employee_cursor into variables 1. v_empFirst 2. v_empLast 3. v_empAddress 4. v_empCity 5. v_empState 6. v_empZip 7. v tHours 8. v_pHourly ii. Check if variable v_finished equals 1; if true, leave the loop using the loop label get_employee iii. Set v_count equal to v_count plus 1 (one) 4 iv. If the variable v_count is equal to 1 (one) 1. Calculate the employee's deposit check using an IF/ELSEIF decision-making construct based on the following business logic a. If the employee's hours (i.e., v_tHours) are less than or equal to 40 then i. set v_deposit equal to the hours multiplied by the hourly rate b. Else If the employee's hours (i.e., v_tHours) are greater than 40 then i. set v_overtime equal to (v_ tHours minus 40) multiplied by (v_pHourly * 1.5) ii. set v_deposit equal to the employee's 40 hours multiplied by their hourly rate (i.e., v_pHourly) iii. set v_deposit equal to v_deposit plus v_overtime 2. Set INOUT parameter deposit equal to concatenated a. deposit 2. Set INOUT parameter deposit equal to concatenated a. deposit b. '\From: ' 3. Set INOUT parameter deposit equal to concatenated a. deposit b. CGS 2545 Regional Airlines ' 4. Set INOUT parameter deposit equal to concatenated a. deposit b. '\\UCF ' 5. Set INOUT parameter deposit equal to concatenated a. deposit b. '\MSB 260 ' 6. Set INOUT parameter deposit equal to concatenated a. deposit b. 'Pay to the order of: ' 7. Set INOUT parameter deposit equal to concatenated a. deposit b. v_empFirst C. d. v_empLast e. ' ' 8. Set INOUT parameter deposit equal to concatenated a. deposit b. v_empAddress c. ' ' 9. Set INOUT parameter deposit equal to concatenated a. deposit b. v_empCity C. " d. v_empState e. f. v_empZip g. ' ' 10. Set INOUT parameter deposit equal to concatenated 5 10. Set INOUT parameter deposit equal to concatenated a. deposit b. 'In the amount of: ' 11. Set INOUT parameter deposit equal to concatenated a. deposit b. '$' C. v_deposit d. ' ' 12. Set INOUT parameter deposit equal to concatenated a. deposit b. *** Pay will be deposited into account number provided *** ' 13. Set INOUT parameter deposit equal to concatenated a. deposit b. ' ' C. v lines d. ' ' h. End the loop using the loop label get_employee i. Close the stored cursor employee_cursor j. End stored procedure k. Set the delimiter back to ; 2. Write the source code to test the stored procedure a. Set session variable @deposit equal to """ b. Call stored procedure passing arguments a. employeeld from table timesheet b. @deposit session variable c. Select @deposit Query Description 1. Change to use the database airline 1. Create stored procedure payDeposit to do the following a. Set the delimiter to $$ b. Parameter list includes 3 i. IN employeeNum INT ii. INOUT deposit VARCHAR(4000) c. Declare the following variables i. v_finished integer DEFAULT 0 ii. v_lines varchar(100) DEFAULT" iii. v_empFirst varchar(100) DEFAULT"" iv. v_empLast varchar(100) DEFAULT"" v. v_empAddress varchar(100) DEFAULT vi. v_empCity varchar(100) DEFAULT"""; vii. v_empState varchar(100) DEFAULT"" viii. v_empZip varchar(100) DEFAULT"" ix. v tHours int DEFAULT 0 X. v_pHourly decimal(5,2) DEFAULT 0.0 xi. v overtime INT DEFAULT 0 xii. v_count integer DEFAULT 0 xiii. v_deposit decimal(8,2) DEFAULT 0.0 "" d. Declare cursor employee_cursor for the following join query i. Select 1. firstName from table employee 2. lastName from table employee 3. address from table employee 4. city from table cityState 5. state from table cityState 6. zipCode from table cityState 7. Sum columns sun, mon, tues, wed, thurs, fri, and sat from table timesheet as hours 8. hourly from table position ii. Where column emploveeld in table timesheet equals the value in e. ii. Where column employeeld in table timesheet equals the value in parameter employee Num Declare continue exception handler for not found set variable v_finished equal to 1 f. Open cursor employee_cursor g. Loop through the employee_cursor, using loop label get_employee i. Fetch employee_cursor into variables 1. v_empFirst 2. v_empLast 3. v_empAddress 4. v_empCity 5. v_empState 6. v_empZip 7. v tHours 8. v_pHourly ii. Check if variable v_finished equals 1; if true, leave the loop using the loop label get_employee iii. Set v_count equal to v_count plus 1 (one) 4 iv. If the variable v_count is equal to 1 (one) 1. Calculate the employee's deposit check using an IF/ELSEIF decision-making construct based on the following business logic a. If the employee's hours (i.e., v_tHours) are less than or equal to 40 then i. set v_deposit equal to the hours multiplied by the hourly rate b. Else If the employee's hours (i.e., v_tHours) are greater than 40 then i. set v_overtime equal to (v_ tHours minus 40) multiplied by (v_pHourly * 1.5) ii. set v_deposit equal to the employee's 40 hours multiplied by their hourly rate (i.e., v_pHourly) iii. set v_deposit equal to v_deposit plus v_overtime 2. Set INOUT parameter deposit equal to concatenated a. deposit 2. Set INOUT parameter deposit equal to concatenated a. deposit b. '\From: ' 3. Set INOUT parameter deposit equal to concatenated a. deposit b. CGS 2545 Regional Airlines ' 4. Set INOUT parameter deposit equal to concatenated a. deposit b. '\\UCF ' 5. Set INOUT parameter deposit equal to concatenated a. deposit b. '\MSB 260 ' 6. Set INOUT parameter deposit equal to concatenated a. deposit b. 'Pay to the order of: ' 7. Set INOUT parameter deposit equal to concatenated a. deposit b. v_empFirst C. d. v_empLast e. ' ' 8. Set INOUT parameter deposit equal to concatenated a. deposit b. v_empAddress c. ' ' 9. Set INOUT parameter deposit equal to concatenated a. deposit b. v_empCity C. " d. v_empState e. f. v_empZip g. ' ' 10. Set INOUT parameter deposit equal to concatenated 5 10. Set INOUT parameter deposit equal to concatenated a. deposit b. 'In the amount of: ' 11. Set INOUT parameter deposit equal to concatenated a. deposit b. '$' C. v_deposit d. ' ' 12. Set INOUT parameter deposit equal to concatenated a. deposit b. *** Pay will be deposited into account number provided *** ' 13. Set INOUT parameter deposit equal to concatenated a. deposit b. ' ' C. v lines d. ' ' h. End the loop using the loop label get_employee i. Close the stored cursor employee_cursor j. End stored procedure k. Set the delimiter back to ; 2. Write the source code to test the stored procedure a. Set session variable @deposit equal to """ b. Call stored procedure passing arguments a. employeeld from table timesheet b. @deposit session variable c. Select @deposit
Expert Answer:
Posted Date:
Students also viewed these databases questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
A random walk in an undirected connected graph moves from a vertex to one of its neighbors, where each possibility has equal probability of being chosen. (This process is the random surfer analog for...
-
A two-axis NC system used to control a machine tool table uses a bit storage capacity of 16 bits in its control memory for each axis. The range of the x-axis is 600 mm and the range of the y-axis is...
-
You wish to attach aluminum sheets to the frame of the twenty-fourth floor of a skyscraper. You plan to use rivets made from an age-hardenable aluminum, but the rivets must be soft and ductile in...
-
Assume the training heart rates of all 20-year-old athletes are normally distributed, with a mean of 135 beats per minute and a standard deviation of 18 beats per minute, as shown in the figure....
-
Define halo error. How can halo error inhibit selecting the best strategies to pursue?
-
Assume you own a bond with a market value of $1, 100 that matures in 14 years. The par value of the bond is $1,000. Interest payments of $35 are paid semiannually. What is your expected rate of...
-
Find a matrix A that induces the transformation T:R?R3 given below. 9x+y X 4x+7y -9x+5y]
-
You are hiking to the top of Mt. Mitchell, NC (elevation 2 km). You start the hike at 0.5 km elevation where the air temperature is 20 C. There are cumulus clouds overhead with the cloud base at 1.5...
-
A special event that is considered incidental generated $470,000 in gross revenues and had direct costs of $350,000 resulting in net cash of $120,000 received. (Note: Record the revenues to Special...
-
Assume that each consumer in Will's town has the following yearly demand for wine: Q120-2P. The cost to produce wine is C=150+10Q. Will wants to start a wine club with an annual membership fee and a...
-
Consider a perfectly competitive firm with the following cost function: TC = 2(Q) + 1600 The firm sells its output for $168 per unit. A. B. C. D. Find the profit-maximizing level of output. Represent...
-
Requirement 1. For each depreciation method, prepare a depreciation schedule showing asset cost, depreciation expense, accumulated depreciation, and asset book value for each year of the asset's...
-
Answer the following questions: 1. Write name one or more factors that should be included in the pricing of the product; please be specific 2. For your subsequent posts I would like you to either i)...
-
On January 2, 20X3, Sheldon Bass, a professional engineer, moved from Calgary to Edmonton to commence employment with Acco Ltd., a large public corporation. Because of his new employment contract,...
-
The system in Figure P1.6 is at $20^{\circ} \mathrm{C}$. If atmospheric pressure is $101.3 \mathrm{kPa}$ and the absolute pressure at the bottom of the tank is $264.1 \mathrm{kPa}$, what is the...
-
A vertical, cylindrical tank with a diameter of $10 \mathrm{~m}$ and a depth of $4 \mathrm{~m}$ is filled to the top with water at $25^{\circ} \mathrm{C}$. If the water is heated to $60^{\circ}...
-
An adult, male giraffe has a blood pressure on the order of $37 \mathrm{kPa}$ above atmospheric pressure. How high can the giraffe heart pump a column of blood with specific gravity of 1.06 ?
Study smarter with the SolutionInn App