Please write an anonymous PL/SQL program which uses an implicit
cursor to print out the score and rank of team 'Mad Scientists' in
the competition 'Science Olympiad Regional Baltimore'. Please
handle exceptions.
Problem 4: [15 points] Please write an anonymous PL/SQL program to
print out the names of students and their school names for the team
that won the first place (rank=1) in Science Olympiad Maryland
State (name of a competition).
drop table school cascade constraints;
drop table student cascade constraints;
drop table team cascade constraints;
drop table competition cascade constraints;
drop table team_result cascade constraints;
create table school
(sid int, -- school id
sname varchar(50), -- school name
primary key(sid));
insert into school values(1, 'Catonsville High');
insert into school values(2, 'MarriottsRidge High');
create table team
(tid int, --- team id
tname varchar(50), --- team name
primary key(tid)
);
insert into team values(1,'Science Genius');
insert into team values(2,'Super robot');
insert into team values(3,'Mad Scientists');
insert into team values(4,'Little Eisenstein');
create table student
(stid int, -- student id
stname varchar(50), --- student name
sid int, --- school id
tid int, --- team id
grade int, --- grade
primary key(stid),
foreign key(sid) references school,
foreign key(tid) references team);
insert into student values(1, 'Anna', 1, 1, 11);
insert into student values(2, 'Erica', 1, 1, 12);
insert into student values(3, 'David', 1, 1, 11);
insert into student values(4, 'Ravi', 1, 2, 11);
insert into student values(5, 'Ali', 1, 2, 12);
insert into student values(6, 'Cathy', 1, 2, 11);
insert into student values(7, 'Grace', 2, 3, 11);
insert into student values(8, 'Megan', 2, 3, 12);
insert into student values(9, 'Jeff', 2, 3, 11);
insert into student values(10, 'Ryan', 2, 4, 11);
insert into student values(11, 'Ron', 2, 4, 12);
insert into student values(12, 'Ella', 2, 4, 11);
create table competition
(cid int, --- competition id
cname varchar(50), --- competition name
cdate date, --- competition date
primary key (cid));
insert into competition values (1, 'Science Olympiad Regional
Baltimore',
date '2020-2-28');
insert into competition values (2, 'Science Olympiad Maryland
State',
date '2020-4-1');
create table team_result
(tid int, --- team id
cid int, --- competition id
score number, --- score of the team in the competition
rank int, --- teams ranking in the competition, smaller the
better
primary key(tid,cid),
foreign key(tid) references team,
foreign key(cid) references competition);
insert into team_result values(1, 1, 95, 2);
insert into team_result values(2, 1, 90, 3);
insert into team_result values(3, 1, 89, 4);
insert into team_result values(4, 1, 99, 1);
insert into team_result values(1, 2, 98, 2);
insert into team_result values(4, 2, 100, 1);
In: Computer Science
13. In terms of indifference curves, an increase in total utility is represented by a:
| A. |
movement upward along an indifference curve. |
|
| B. |
shift to the left to a lower indifference curve. |
|
| C. |
movement downward along an indifference curve. |
|
| D. |
shift to the right to a higher indifference curve. |
14. A consumer has a budget of $60 and wishes to purchase both products A and B. The price of product A is $8.42, while the price of product B is $26.32. The marginal utilities of the two products are provided in the table below.
|
Q |
MUA |
MUB |
|
1 |
17 |
25 |
|
2 |
14 |
24 |
|
3 |
11 |
23 |
|
4 |
8 |
22 |
|
5 |
5 |
21 |
|
6 |
2 |
20 |
|
7 |
0 |
19 |
|
8 |
0 |
18 |
|
9 |
0 |
17 |
|
10 |
0 |
16 |
The optimal bundle is ____ of product A and ____ of
product B.
| A. |
5 ; 1 |
|
| B. |
3 ; 2 |
|
| C. |
5 ; 2 |
|
| D. |
4 ; 1 |
|
| E. |
2 ; 0 |
Rudolph has a budget of $22 to spend on rice ( R) and chicken nuggets ( N). The price of rice is $4.04 per pound, and the price of chicken nuggets is $3.28 per unit. The table below shows the marginal utilities that the consumer gets from the different quantities of both.
|
Q |
MUR |
MUN |
|
1 |
20 |
19 |
|
2 |
18 |
16 |
|
3 |
16 |
13 |
|
4 |
14 |
10 |
|
5 |
12 |
7 |
|
6 |
10 |
4 |
|
7 |
8 |
1 |
|
8 |
6 |
0 |
|
9 |
4 |
0 |
|
10 |
2 |
0 |
What is the optimal bundle of rice and chicken nuggets (
QR, QN) for Rudolph? (
QR, QN) =
| A. |
(3, 3) |
|
| B. |
(4, 4) |
|
| C. |
(2, 4) |
|
| D. |
(4, 3) |
|
| E. |
(4, 2) |
In: Economics
A community health association is interested in estimating the average number of maternity days women stay in the local hospital. A random sample is taken of 36 women who had babies in the hospital during the past year. The following numbers of maternity days each woman was in the hospital are rounded to the nearest day. 3 3 4 3 2 5 3 1 4 3 4 2 3 5 3 2 4 3 2 2 1 6 3 4 3 3 5 2 3 3 3 5 4 3 5 4 Use these data and a population standard deviation of 1.12 to construct a 98% confidence interval to estimate the average maternity stay in the hospital for all women who have babies in this hospital.
In: Statistics and Probability
1- Use calculus to find the absolute maximum and minimum values of the following functions on the given intervals. Give your answers exactly and show supporting work.
f(x) = (7x − 1)e^−2x on [0, 1]
f(x) = x^4 − 2x^2 + 4 on [0, 2]
f(x) = x^3 − 2x^2 + x + 1 on [0, 1]
In: Math
Round answers to 5 decimal places. Suppose there are two consumers, A and B, and two goods, X and Y. Consumer A is given an initial endowment of 3 units of good X and 7 units of goodY. Consumer B is given an initial endowment of 8 units of good X and 5 units of good Y. ConsumerA’s utility function is given by:UA(X, Y) =X^1/2 Y^1/2 and Consumer B’s utility function is given byUB(X, Y) =X^1/5 Y^4/5. Therefore, the marginal utilities are as follows:
MU X/A= 1/2X^-1/2 Y^1/2
MU Y/A= 1/2X^1/2 Y^−1/2
MU XB= 1/5X^−4/5 Y^3/4
MU YB= 4/5X^1/5 Y^−1/5
1) How much of each good does consumer A demand in equilibrium?
2) How much of each good does consumer B demand in equilibrium?
3) What is the MRS for consumer B at the competitive equilibrium?
4) Illustrate the situation in an Edgeworth Box. Be sure to label your box carefully andaccurately. Identify the initial endowment and label it M. Identify the competitive equilibrium and label it C. Draw the budget constraint that each consumer faces and identify the values where it intersects the perimeter of the Edgeworth Box (there are 2 different intercepts to identify for each consumer).
In: Economics
Consider the following time series data.
| Quarter | Year 1 | Year 2 | Year 3 |
| 1 | 2 | 5 | 7 |
| 2 | 0 | 2 | 6 |
| 3 | 5 | 8 | 10 |
| 4 | 5 | 8 | 10 |
| b) | Use a multiple regression model with dummy variables as follows to develop an equation to account for seasonal effects in the data. Qtr1 = 1 if Quarter 1, 0 otherwise; Qtr2 = 1 if Quarter 2, 0 otherwise; Qtr3 = 1 if Quarter 3, 0 otherwise. | ||||||||||||||||||||
| If required, round your answers to three decimal places. For subtractive or negative numbers use a minus sign even if there is a + sign before the blank. (Example: -300) If the constant is "1" it must be entered in the box. Do not round intermediate calculation. | |||||||||||||||||||||
| ŷ = + Qtr1 + Qtr2 + Qtr3 | |||||||||||||||||||||
| (c) | Compute the quarterly forecasts for next year based on the model you developed in part (b). | ||||||||||||||||||||
| If required, round your answers to three decimal places. Do not round intermediate calculation. | |||||||||||||||||||||
|
|||||||||||||||||||||
| (d) | Use a multiple regression model to develop an equation to account for trend and seasonal effects in the data. Use the dummy variables you developed in part (b) to capture seasonal effects and create a variable tsuch that t = 1 for Quarter 1 in Year 1, t = 2 for Quarter 2 in Year 1,… t = 12 for Quarter 4 in Year 3. | ||||||||||||||||||||
| If required, round your answers to three decimal places. For subtractive or negative numbers use a minus sign even if there is a + sign before the blank. (Example: -300) | |||||||||||||||||||||
| ŷ = + Qtr1 + Qtr2 + Qtr3 + t | |||||||||||||||||||||
| (e) | Compute the quarterly forecasts for next year based on the model you developed in part (d). | ||||||||||||||||||||
| Do not round your interim computations and round your final answer to three decimal places. | |||||||||||||||||||||
|
|||||||||||||||||||||
| (f) | Is the model you developed in part (b) or the model you developed in part (d) more effective? | ||||||||||||||||||||
| If required, round your intermediate calculations and final answer to three decimal places. | |||||||||||||||||||||
|
|||||||||||||||||||||
| - Select your answer -Model developed in part (b)Model developed in part (d)Item 22 | |||||||||||||||||||||
| Justify your answer. | |||||||||||||||||||||
| The input in the box below will not be graded, but may be reviewed and considered by your instructor. |
Please show steps to solve using Excel.
In: Statistics and Probability
Use Tornadoes data and your statistical expertise to answer the questions: Is it reasonable to claim that on average October has less than four tornado-related deaths (per year)?
9. What test/procedure did you perform?
a. One-sided t-test
b. Two-sided t-test
c. Regression
d. Confidence interval
10. What is the P-value/margin of error?
a. 0.723595771
b. 1.8
c. 3.684118249
d. 1.10683165
e. None of these
11. Statistical Interpretation
a. Since the confidence interval of 3.68411 is below 4, we are confident that the number of tornado-related deaths is below 4.
b. Since the P-value is not small, we cannot claim that the number of tornado-related deaths is below 4.
c. Since confidence interval is above 4, we cannot claim that the number of tornado-related deaths is below 4.
d. None of these
12. Conclusion
a. Yes, I am confident that the above assertion is reasonable.
b. No, we cannot claim that the above assertion is reasonable.
| Tornadoes and Deaths by Year and Month (1950-1994) | ||||||||||||||||||||||||||
| Year | Total Tornadoes | Tornadoes by Month | Total Deaths | Deaths by Month | ||||||||||||||||||||||
| Jan | Feb | Mar | Apr | May | June | July | Aug | Sept | Oct | Nov | Dec | Jan | Feb | Mar | Apr | May | June | July | Aug | Sept | Oct | Nov | Dec | |||
| 1950 | 201 | 7 | 20 | 21 | 15 | 61 | 28 | 23 | 13 | 3 | 2 | 4 | 4 | 70 | 1 | 45 | 1 | 12 | 2 | 6 | 0 | 0 | 0 | 0 | 0 | 3 |
| 1951 | 260 | 2 | 10 | 6 | 26 | 57 | 76 | 23 | 27 | 9 | 2 | 12 | 10 | 34 | 0 | 1 | 0 | 2 | 7 | 9 | 5 | 0 | 8 | 0 | 1 | 1 |
| 1952 | 240 | 12 | 27 | 43 | 37 | 34 | 34 | 27 | 16 | 1 | 0 | 6 | 3 | 230 | 0 | 10 | 209 | 4 | 2 | 2 | 2 | 1 | 0 | 0 | 0 | 0 |
| 1953 | 422 | 14 | 16 | 40 | 47 | 94 | 111 | 32 | 24 | 5 | 6 | 12 | 21 | 519 | 0 | 3 | 24 | 36 | 163 | 244 | 0 | 0 | 0 | 0 | 0 | 49 |
| 1954 | 550 | 2 | 17 | 62 | 113 | 101 | 107 | 45 | 49 | 21 | 14 | 2 | 17 | 36 | 0 | 2 | 10 | 2 | 9 | 5 | 0 | 1 | 3 | 2 | 0 | 2 |
| 1955 | 593 | 3 | 4 | 43 | 99 | 148 | 153 | 49 | 33 | 15 | 23 | 20 | 3 | 129 | 0 | 0 | 5 | 7 | 106 | 2 | 5 | 0 | 2 | 1 | 1 | 0 |
| 1956 | 504 | 2 | 47 | 31 | 85 | 79 | 65 | 92 | 42 | 16 | 29 | 7 | 9 | 83 | 0 | 8 | 1 | 67 | 4 | 0 | 1 | 2 | 0 | 0 | 0 | 0 |
| 1957 | 858 | 17 | 5 | 38 | 216 | 228 | 147 | 55 | 20 | 17 | 18 | 59 | 38 | 193 | 13 | 0 | 1 | 30 | 87 | 14 | 0 | 0 | 2 | 2 | 25 | 19 |
| 1958 | 564 | 11 | 20 | 15 | 76 | 68 | 128 | 121 | 46 | 24 | 9 | 45 | 1 | 67 | 0 | 13 | 0 | 4 | 0 | 43 | 1 | 1 | 1 | 4 | 0 | 0 |
| 1959 | 604 | 16 | 20 | 43 | 30 | 226 | 73 | 63 | 38 | 58 | 24 | 11 | 2 | 58 | 3 | 21 | 9 | 1 | 8 | 2 | 0 | 0 | 14 | 0 | 0 | 0 |
| 1960 | 616 | 9 | 28 | 28 | 70 | 201 | 125 | 42 | 48 | 21 | 18 | 25 | 1 | 46 | 0 | 0 | 0 | 7 | 34 | 3 | 0 | 1 | 0 | 1 | 0 | 0 |
| 1961 | 697 | 1 | 31 | 124 | 74 | 137 | 107 | 77 | 27 | 53 | 14 | 36 | 16 | 52 | 0 | 0 | 7 | 4 | 23 | 2 | 0 | 0 | 15 | 0 | 1 | 0 |
| 1962 | 657 | 12 | 25 | 37 | 41 | 200 | 171 | 78 | 51 | 24 | 11 | 5 | 2 | 30 | 1 | 0 | 17 | 2 | 4 | 0 | 0 | 6 | 0 | 0 | 0 | 0 |
| 1963 | 463 | 15 | 6 | 48 | 84 | 71 | 90 | 62 | 26 | 33 | 13 | 15 | 0 | 31 | 1 | 0 | 8 | 16 | 1 | 0 | 0 | 2 | 3 | 0 | 0 | 0 |
| 1964 | 704 | 14 | 2 | 36 | 157 | 134 | 137 | 63 | 79 | 25 | 22 | 17 | 18 | 73 | 10 | 0 | 6 | 15 | 16 | 0 | 0 | 2 | 0 | 22 | 0 | 2 |
| 1965 | 897 | 21 | 32 | 34 | 123 | 273 | 147 | 85 | 61 | 64 | 16 | 34 | 7 | 301 | 0 | 0 | 2 | 268 | 17 | 7 | 0 | 1 | 0 | 1 | 5 | 0 |
| 1966 | 585 | 1 | 28 | 12 | 80 | 98 | 126 | 100 | 58 | 22 | 29 | 20 | 11 | 98 | 0 | 0 | 58 | 12 | 0 | 19 | 3 | 0 | 0 | 6 | 0 | 0 |
| 1967 | 926 | 39 | 8 | 42 | 149 | 116 | 210 | 90 | 28 | 139 | 36 | 8 | 61 | 114 | 7 | 0 | 3 | 73 | 3 | 6 | 1 | 2 | 5 | 4 | 0 | 10 |
| 1968 | 660 | 5 | 7 | 28 | 102 | 145 | 136 | 56 | 66 | 25 | 14 | 44 | 32 | 131 | 0 | 0 | 0 | 40 | 72 | 11 | 2 | 2 | 0 | 0 | 3 | 1 |
| 1969 | 608 | 3 | 5 | 8 | 68 | 145 | 137 | 98 | 70 | 20 | 26 | 5 | 23 | 66 | 32 | 0 | 1 | 2 | 4 | 7 | 0 | 19 | 0 | 0 | 0 | 1 |
| 1970 | 654 | 9 | 16 | 25 | 117 | 88 | 134 | 82 | 55 | 54 | 50 | 10 | 14 | 73 | 0 | 0 | 2 | 30 | 26 | 6 | 3 | 0 | 0 | 6 | 0 | 0 |
| 1971 | 889 | 19 | 83 | 40 | 75 | 166 | 199 | 100 | 50 | 47 | 38 | 16 | 56 | 159 | 1 | 134 | 2 | 11 | 7 | 1 | 1 | 0 | 0 | 0 | 0 | 2 |
| 1972 | 741 | 33 | 7 | 69 | 96 | 140 | 114 | 115 | 59 | 49 | 34 | 17 | 8 | 27 | 5 | 0 | 0 | 16 | 0 | 2 | 0 | 2 | 0 | 0 | 2 | 0 |
| 1973 | 1102 | 33 | 10 | 80 | 150 | 250 | 224 | 80 | 51 | 69 | 25 | 81 | 49 | 89 | 1 | 0 | 17 | 10 | 35 | 3 | 1 | 4 | 3 | 0 | 12 | 3 |
| 1974 | 945 | 24 | 23 | 36 | 267 | 144 | 194 | 59 | 107 | 25 | 45 | 13 | 8 | 366 | 2 | 0 | 1 | 317 | 10 | 31 | 0 | 0 | 0 | 5 | 0 | 0 |
| 1975 | 919 | 52 | 45 | 84 | 108 | 188 | 196 | 79 | 60 | 34 | 12 | 39 | 22 | 60 | 12 | 7 | 12 | 13 | 5 | 6 | 2 | 2 | 0 | 0 | 0 | 1 |
| 1976 | 834 | 12 | 36 | 180 | 113 | 155 | 169 | 84 | 38 | 35 | 11 | 0 | 1 | 44 | 0 | 5 | 21 | 1 | 8 | 3 | 2 | 1 | 3 | 0 | 0 | 0 |
| 1977 | 852 | 5 | 17 | 64 | 88 | 228 | 132 | 99 | 82 | 65 | 25 | 24 | 23 | 43 | 0 | 2 | 0 | 26 | 4 | 0 | 1 | 6 | 1 | 1 | 0 | 2 |
| 1978 | 789 | 23 | 7 | 17 | 107 | 213 | 148 | 143 | 65 | 20 | 7 | 9 | 30 | 53 | 2 | 0 | 0 | 4 | 7 | 17 | 11 | 1 | 6 | 0 | 0 | 5 |
| 1979 | 855 | 16 | 4 | 53 | 123 | 112 | 150 | 132 | 126 | 69 | 47 | 21 | 2 | 84 | 0 | 0 | 1 | 58 | 2 | 8 | 1 | 5 | 2 | 7 | 0 | 0 |
| 1980 | 866 | 5 | 11 | 41 | 137 | 203 | 217 | 95 | 73 | 37 | 43 | 3 | 1 | 28 | 0 | 0 | 2 | 4 | 8 | 7 | 5 | 0 | 1 | 1 | 0 | 0 |
| 1981 | 782 | 2 | 25 | 33 | 84 | 187 | 223 | 98 | 64 | 26 | 32 | 7 | 1 | 24 | 0 | 2 | 1 | 13 | 0 | 8 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1982 | 1047 | 18 | 3 | 60 | 150 | 329 | 196 | 95 | 34 | 38 | 9 | 19 | 96 | 64 | 1 | 0 | 6 | 30 | 14 | 4 | 0 | 0 | 2 | 0 | 0 | 7 |
| 1983 | 931 | 13 | 41 | 71 | 65 | 249 | 178 | 99 | 76 | 19 | 13 | 49 | 58 | 34 | 2 | 1 | 0 | 6 | 14 | 2 | 4 | 0 | 0 | 0 | 0 | 5 |
| 1984 | 907 | 1 | 27 | 73 | 176 | 169 | 242 | 72 | 47 | 17 | 49 | 30 | 4 | 122 | 0 | 0 | 64 | 33 | 6 | 14 | 0 | 0 | 0 | 4 | 1 | 0 |
| 1985 | 684 | 2 | 7 | 38 | 134 | 182 | 82 | 51 | 108 | 40 | 18 | 19 | 3 | 94 | 0 | 0 | 2 | 5 | 78 | 3 | 0 | 3 | 0 | 0 | 3 | 0 |
| 1986 | 765 | 0 | 30 | 76 | 84 | 173 | 134 | 88 | 67 | 65 | 26 | 17 | 5 | 15 | 0 | 2 | 6 | 2 | 1 | 0 | 3 | 1 | 0 | 0 | 0 | 0 |
| 1987 | 656 | 6 | 19 | 38 | 20 | 126 | 132 | 163 | 63 | 19 | 1 | 55 | 14 | 59 | 0 | 6 | 1 | 1 | 31 | 2 | 0 | 1 | 0 | 0 | 11 | 6 |
| 1988 | 702 | 17 | 4 | 28 | 58 | 132 | 63 | 103 | 61 | 76 | 19 | 121 | 20 | 32 | 5 | 0 | 1 | 4 | 3 | 0 | 0 | 3 | 1 | 0 | 14 | 1 |
| 1989 | 856 | 14 | 18 | 43 | 82 | 231 | 252 | 59 | 36 | 31 | 30 | 57 | 3 | 50 | 0 | 0 | 1 | 0 | 9 | 5 | 0 | 0 | 0 | 4 | 31 | 0 |
| 1990 | 1133 | 11 | 57 | 86 | 108 | 243 | 329 | 106 | 60 | 45 | 35 | 18 | 35 | 53 | 0 | 1 | 3 | 0 | 5 | 11 | 0 | 29 | 0 | 2 | 0 | 2 |
| 1991 | 1132 | 29 | 11 | 157 | 204 | 335 | 216 | 64 | 46 | 26 | 21 | 20 | 3 | 39 | 1 | 0 | 13 | 21 | 0 | 1 | 1 | 0 | 0 | 0 | 2 | 0 |
| 1992 | 1297 | 15 | 29 | 55 | 53 | 137 | 399 | 213 | 115 | 81 | 34 | 146 | 20 | 39 | 0 | 0 | 5 | 0 | 0 | 1 | 0 | 3 | 0 | 4 | 26 | 0 |
| 1993 | 1173 | 17 | 34 | 48 | 85 | 177 | 313 | 242 | 112 | 65 | 55 | 19 | 6 | 33 | 0 | 3 | 5 | 10 | 2 | 1 | 0 | 6 | 2 | 4 | 0 | 0 |
| 1994 | 1082 | 13 | 9 | 58 | 205 | 161 | 234 | 155 | 120 | 30 | 51 | 42 | 4 | 69 | 0 | 0 | 40 | 12 | 0 | 3 | 3 | 4 | 0 | 0 | 7 | 0 |
In: Statistics and Probability
which of the following sets of quantum numbers (n,l,m) is not possible? a. 3 3 -3 +1/2 b. 2 1 -1 +1/2 c. 2 0 0 +1/2 d. 2 1 0 +1/2 e. 4 2 -1 -1/2
In: Chemistry
In: Computer Science
What are the products of gametogenesis?
A. Females- 1 egg ; Males- 2 sperm
B. Females – 4 eggs ; Males- 4 sperm
C. Females- 4 eggs ; Males- 1 sperm
D. Females- 1 egg ; Males- 4 sperm
In: Biology