The CGI program cgi-bin/sale_entry_form.cgi provides a form which can be used to record the occurence of a sale
Write a script which records the sale in the sales table (answer in public_html/cgi-bin/sale_entry.cgi)
Your script will also have to update the stock_item table to reduce the number of items still in stock.
What happens if you try to buy/sell more items than are available? Put in a check to stop this from happening.