Computer Science – 8.3 Data Definition Language (DDL) and Data Manipulation Language (DML) | e-Consult
8.3 Data Definition Language (DDL) and Data Manipulation Language (DML) (1 questions)
Login to see all questions.
Click on a question to view the answer
`sql
UPDATE Inventory
JOIN Products p ON Inventory.ProductID = p.ProductID
SET Quantity = Quantity - (Inventory.Quantity * 0.10);
`
Explanation:
- The query joins the Inventory and Products tables using the ProductID column.
- The UPDATE statement modifies the Quantity in the Inventory table.
- The SET clause subtracts 10% of the current Quantity from the Quantity.