Question: 4. Assuming the data is stored in a relational database with the conceptual schema as shown in the ERD in Case Study 1, write a

 4. Assuming the data is stored in a relational database with

the conceptual schema as shown in the ERD in Case Study 1,

4. Assuming the data is stored in a relational database with the conceptual schema as shown in the ERD in Case Study 1, write a PL/SQL program, complete with error checking, to add an extra order in the following steps: (a) Using substitution variables, accept a student_no, order_date, item_number, quantity and room_key. (4 marks) (b) Verify that the student exists and owes less than 50. If this is not the case, report that the student is not eligible to order and exit without amending the data. 7 marks) (c) Verify that the item is on the menu and is available (item_availableyn = ' Y '). If this is not the case, report that the item is not available and exit without amending the data. (7 marks) (d) Add the new order, with the value ' N ' for DeliveredYN, reporting that the order has been placed, making all changes persistent, handling errors that may arise. (12 marks) NOTE: Reporting implies displaying the message on the screen. A university runs a residence on the college campus, for its students. Students who are studying in the college can rent rooms in the residence. There are different types of apartments; some have individual rooms with en-suites, but share a kitchen and living area between four or six students. Some are for couples and these have their own apartement. Undergraduates are in a different wing to postgraduates. Every student has access to a kitchen, but there is also on-site catering, that can either be collected or delivered to a room. There is a standing charge of 200 at the start of the residency, giving the student an AMOUNT_OWING amount of 200. Students can go into arrears of 50. When this is used up, students cannot order any more until they pay. The residence records each order and students in arrears are sent a bill at the end of each month. The record of orders is kept until the end of the academic year

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!