- Now that all the papers are signed, update the most recently closed
- deal of the travelling salesperson who closed the Rocket Powered
- Skates deal with the Acme Corporation.
-UPDATE employees SET last_closed_deal = deal.id
- FROM accounts JOIN deals ON (account.id = deal.account_id)
- WHERE deal.employee_id = employees.id
- AND deal.name = 'Rocket Powered Skates'
- AND accounts.name = 'Acme Corporation'
- ORDER BY deal.signed_date DESC LIMIT 1;
-
-
-
Attempt to insert a new stock item along with the quantity of stock. If
the item already exists, instead update the stock count of the existing