Write a SQL Query that deducts one percent from the amounts paid for purchases m
ID: 3753132 • Letter: W
Question
Write a SQL Query that deducts one percent from the amounts paid for purchases made in the month of December. The amounts customers paid are listed in the payments table. The output of your script should show the payments before the rebate and the payments after the rebate.
The MySQL sample database schema consists of the following tables:
Customers: stores customer’s data.
Products: stores a list of scale model cars.
ProductLines: stores a list of product line categories.
Orders: stores sales orders placed by customers.
OrderDetails: stores sales order line items for each sales order.
Payments: stores payments made by customers based on their accounts.
Employees: stores all employee information as well as the organization structure such as who reports to whom.
Offices: stores sales office data.
Thank you.
Explanation / Answer
Query is:
update offices,orders set offices.amount=offices.amount-(offices.amount%1) where order.month="December"
Here i dont now exact rows but ,its the way of doing query
i have used offices for money and orders for month of order and deducted amount by 1% where month= december and updated in offices
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.