Question: need help with mysql. HW1.9. Trigger to avail discount on repeated purchases Customers Name Type Customerld FirstName INT VARCHAR(255) LastName VARCHAR(255) Phone Number REAL Purchases
need help with mysql.

HW1.9. Trigger to avail discount on repeated purchases Customers Name Type Customerld FirstName INT VARCHAR(255) LastName VARCHAR(255) Phone Number REAL Purchases Name Type Purchaseld INT Customerld INT Productld INT Price INT Products Name Type Productld INT ProductName VARCHAR(255) Brand Name VARCHAR(255) Year Released INT Brands Name Type Brand Name VARCHAR(255) Year Established INT CEO VARCHAR(255) Given the above mobile phone store schema, write a Trigger in SQL that checks if the same customer has purchased the same product before, and if so, it gives the customer 30% discount on the purchase price. This trigger should be executed BEFORE any INSERT operation on the Purchases table. Verify the result by inserting (500, 20, 5, 500) record into the Purchases table. Please do not use DELIMITER. Start with the CREATE statement and use the semicolon as your delimiter. query.sql 1 Restore original file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
