1. Suppose you are automating operations for a store selling PCs. All PCs of a certain model number are equivalent as far as buyers are concerned, but the store wants to sell them in FIFO (first-in, first-out) order so that no box gets too worn-looking. Each PC has a model number (int), serial number (10-char string), vendor id (int), and delivery date (int day number.)

a. Using our client-server database applications technology, how should we hold the data on all the PCs to support this application? Write the SQL that the program needs to use to create an empty version of the data holder.

b. Given a model number, say 1234, for the next PC to sell, write the SQL query that determines the serial number of the PC that should be selected for the customer.

c. Design a domain class and DAO API (method signatures only) for this app that supports insert as well as the retrieval as described above.

2. In the same scenario as problem 1, once a PC is sold, we need to keep track of the customer for each individual PC. Each PC has a unique customer but a single customer can purchase multiple PCs. Each customer has a string name and a social security number (ssn, an integer).

a. How should we hold the data on customers? As in la, show the creation of the data holder using SQL.

b. What foreign key constraint can be added to this system to improve its integrity?

Web Background

a. Write two simple web pages a.html and b.html that reside in the same directory with local path /testmsg on a certain web server. Page a links to page b, and page b has a form with a single text input with name "msg", no ACTION specified, but with a submit button.

b. Suppose a user browses to page a.html as served by the web server, follows the link to b.html, and then fills in "hello" in the text box and clicks the submit button. Give the sequence of HTTP request and responses to this web server that would happen, stopping after the request that carries the "hello" data back to the server (using b.html's local path, the default ACTION URI.) Assume that a.html and b.html have no images or CSS files.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.