Please write a stored procedure named pHW_6_xxxx( student) which will display the student's transcript by the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Please write a stored procedure named pHW_6_xxxx( student) which will display the student's transcript by the input (semester, year). Your program needs to meet the following requirements and test cases. a. If the input year is "*", the report should have all students for all years. b. If the input semester is "*", the report should have all the terms in that year. c. If the input semester or year is empty or null, a corresponding error message should be printed. d. If there is no student for the input semester/year, the output message should say "year xxxx, semester zzzz has no students in the system". If there are students found for the input semester/year, print the report with the format based on the test cases. The report should be sorted by the student's last name, first_name from A to Z, year from low to high, semester from spring to fall. Please refer to Students, Courses, Students_Courses tables. e. f. g. Data entry validation for year. call pHW_6_demo(", "); > call pHW_6_demo('Fall', null); The above SQL statement should have output: I message | I Please enter a valid year. > call pHW_6_demo(", 2012); call pHW_6_demo(null, 2012); The above SQL statement should have output: +-- I message I +--- I Please enter a valid semester. 1 The message when no students are found. ) Data entry validation for semester. > call pHW_6_demo('*', 2030); > call pHW_6_demo('Spring', 2013); The above SQL statement should have output: I message 1 Year: 2030, semester: * has no students in the system. I I message 1 Year: 2013, semester: Spring has no students in the system. I A report shows students for a specific semesster and year. pHW_6_demo(Fall", 2014); > call The above SQL statement should have output: I last name I first_name I year I semester I Lee I Lee I Claudia I 2014 | Fall I Sarah I 2014 | Fall | 2014 | Fall I Lin I Andrew I Loo I Lee I Lin I Lin I Lin A report shows the students for all semesters in a specific year. > call pHW_6_demo(***, 2014); The above SQL statement should have output: I last name I first name I year 1 semester I Claudia | 2014 | I 2014 I Sarah I Andreu I 2014 | Spring I Andreu I 2014 | Spring I Andreu I 2014 Fall I 1 Mu > call pHW_6_demo("*" "*"); The above SQL statement should have output: Fall Fall I Claudia I Sarah. I Sarah I Andrew I Andreu I Andrew I Andrew I Helen I last name I first_name year I semester I cid I Austin I Huang I Huang I Austin. | 2013 | Fall I 2016 I Fall I 2017 | I Huang I Austin. I Lee I Claudia | 2014 | I Lee Claudia I I Claudia I Lee I Lee I Lee I Lee I Lin I Lin I Lin Lin A report shows all students for all semesters and years. Spring Fall I cid I CPS2231 | Java2 | CPS3748 | Database Introductio I CPS2232 | Data Structure I 2015 | Spring I 2016 | Spring I 2016 I Fall | 2014 | Fall I 2015 | Spring Fall I 2013 | I 2014 | Spring I 2014 | Spring name | 2014 | Fall I 2016 | Spring I cid I CPS2231 | Java2 I CPS3740 | Database Introductio I name I CPS2232 | Data Structure I CPS2231 | Java2 I CPS2232 | Data Structure I name 1 CPS2231 | Java2 I CPS2231 | Java2 I CPS2232 | Data Structure 1 CPS2231 | Java2 I grade I IF | A IC 1 I CPS2232 | Data Structure I CPS2231 | Java2 I grade I IF | A I B+ IA- IC I CPS2231 | Java2 I CPS2232 | Data Structure 1 CPS3500 | Web Programming | CPS2231 | Java2 IF 1 CPS2231 | Java2 IA 1 CPS5921 | Data Mining 18 I CPS5920 | Database Systems IC 1 CPS3740 | Database Introductio | A I grade I I A- I C+ I C+ IB IC I I I B+ I A- IC IA I 1 1 Please write a stored procedure named pHW_6_xxxx( student) which will display the student's transcript by the input (semester, year). Your program needs to meet the following requirements and test cases. a. If the input year is "*", the report should have all students for all years. b. If the input semester is "*", the report should have all the terms in that year. c. If the input semester or year is empty or null, a corresponding error message should be printed. d. If there is no student for the input semester/year, the output message should say "year xxxx, semester zzzz has no students in the system". If there are students found for the input semester/year, print the report with the format based on the test cases. The report should be sorted by the student's last name, first_name from A to Z, year from low to high, semester from spring to fall. Please refer to Students, Courses, Students_Courses tables. e. f. g. Data entry validation for year. call pHW_6_demo(", "); > call pHW_6_demo('Fall', null); The above SQL statement should have output: I message | I Please enter a valid year. > call pHW_6_demo(", 2012); call pHW_6_demo(null, 2012); The above SQL statement should have output: +-- I message I +--- I Please enter a valid semester. 1 The message when no students are found. ) Data entry validation for semester. > call pHW_6_demo('*', 2030); > call pHW_6_demo('Spring', 2013); The above SQL statement should have output: I message 1 Year: 2030, semester: * has no students in the system. I I message 1 Year: 2013, semester: Spring has no students in the system. I A report shows students for a specific semesster and year. pHW_6_demo(Fall", 2014); > call The above SQL statement should have output: I last name I first_name I year I semester I Lee I Lee I Claudia I 2014 | Fall I Sarah I 2014 | Fall | 2014 | Fall I Lin I Andrew I Loo I Lee I Lin I Lin I Lin A report shows the students for all semesters in a specific year. > call pHW_6_demo(***, 2014); The above SQL statement should have output: I last name I first name I year 1 semester I Claudia | 2014 | I 2014 I Sarah I Andreu I 2014 | Spring I Andreu I 2014 | Spring I Andreu I 2014 Fall I 1 Mu > call pHW_6_demo("*" "*"); The above SQL statement should have output: Fall Fall I Claudia I Sarah. I Sarah I Andrew I Andreu I Andrew I Andrew I Helen I last name I first_name year I semester I cid I Austin I Huang I Huang I Austin. | 2013 | Fall I 2016 I Fall I 2017 | I Huang I Austin. I Lee I Claudia | 2014 | I Lee Claudia I I Claudia I Lee I Lee I Lee I Lee I Lin I Lin I Lin Lin A report shows all students for all semesters and years. Spring Fall I cid I CPS2231 | Java2 | CPS3748 | Database Introductio I CPS2232 | Data Structure I 2015 | Spring I 2016 | Spring I 2016 I Fall | 2014 | Fall I 2015 | Spring Fall I 2013 | I 2014 | Spring I 2014 | Spring name | 2014 | Fall I 2016 | Spring I cid I CPS2231 | Java2 I CPS3740 | Database Introductio I name I CPS2232 | Data Structure I CPS2231 | Java2 I CPS2232 | Data Structure I name 1 CPS2231 | Java2 I CPS2231 | Java2 I CPS2232 | Data Structure 1 CPS2231 | Java2 I grade I IF | A IC 1 I CPS2232 | Data Structure I CPS2231 | Java2 I grade I IF | A I B+ IA- IC I CPS2231 | Java2 I CPS2232 | Data Structure 1 CPS3500 | Web Programming | CPS2231 | Java2 IF 1 CPS2231 | Java2 IA 1 CPS5921 | Data Mining 18 I CPS5920 | Database Systems IC 1 CPS3740 | Database Introductio | A I grade I I A- I C+ I C+ IB IC I I I B+ I A- IC IA I 1 1
Expert Answer:
Related Book For
Concepts of Database Management
ISBN: 978-111182591
7th edition
Authors: Philip J. Pratt, Joseph J. Adamski
Posted Date:
Students also viewed these databases questions
-
What is the incumbency advantage?
-
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...
-
Differences arising between the actual and expected values of the pension contributions What are actuarial losses or gains in a defined benefit plan?
-
Three Zero Coupon Bonds (ZCB) are issued on the market. They each have face value of 100 and maturity, respectively, of 1 year, 3 years and 4 years. Assume the first bond is sold for 99.01, the...
-
It is desired that the reflectivity of light at normal incidence to the surface of a transparent medium be less than 5.0%. Which of the following materials in Table 21.1 are likely candidates:...
-
Brian Cleary and Rita Burke filed a suit against the major cigarette maker Philip Morris USA, Inc., seeking class-action status for a claim of deceptive advertising. Cleary and Burke claimed that...
-
True or False. The value of the gage factor of a strain gage is given by the manufacturer.
-
H & K Electronic Warehouse sells a 12-pack of AAA batteries, and this is a very popular item. Demand for this is normally distributed, with an average of 50 packs per day and a standard deviation of...
-
How do cultural differences across global branches of a multinational organization affect organizational commitment, and what can be done to ensure consistent commitment levels across diverse teams ?
-
How would the companys cash needs change for the company in Examples 14-1 to 14-5 if the third project started in May instead of February and the retention was not released until the following year?
-
John Vincent invested $10,000 in a savings account. The account pays 4% annual interest. John will have how much in the account at the end of 10 years? Round to the nearest dollar... (the table below...
-
To create foreign keys between Tables, first one must select the Table that contains a key and then select another Table that has a key a. Primary, foreign b. Primary, primary c. Foreign, primary d....
-
In a small university, the Computer Science Department has six faculty members. However, each faculty member belongs to only the computer science department. This type of relationship is called a....
-
Reducing data redundancy will lead to a. Deletion anomalies b. Data consistency c. Loss of efficiency d. None of the above
-
Each relational database Table can contain multiple primary keys but only one unique foreign key. (True/False)
-
When a user perceives the database as made up of Tables, it is called a network model. (True/False)
-
Suppose Bank A and Bank B are signing 96 days SWAP contract according to the following information: Bank A pays a fixed interest rate Bank B pays a floating interest rate The value of the contract is...
-
a. Show that the expansion of q(x) in ascending powers of x can be approximated to 10 2x + Bx 2 + Cx 3 where B and C are constants to be found. b. Find the percentage error made in using the series...
-
What are data archives? What purpose do they serve? What is the relationship between a database and its data archives?
-
What are dynamic Web pages? How can you augment HTML to provide the dynamic capability?
-
Describe the function of each of the following types of keys: primary, alternate, secondary, and foreign.
-
Ludwig and Miller (2007) used a discontinuity in program funding for Head Start to test the impacts on child mortality rates. In the 1960s, the federal government helped 300 of the poorest counties...
-
The standard enthalpy change of combustion of acetylene is \(-1300.48 \mathrm{~kJ}\) at \(298 \mathrm{~K}\) with \(\mathrm{H}_{2} \mathrm{O}\) in the liquid state. Calculate the standard enthalpy of...
-
Which instrument is used to determine the heat of combustion of a fuel?
Study smarter with the SolutionInn App