Hi sorry for the inconvenience of posting a bad question. So below is the edit version of the question:
Purpose of this task: In this task, I am trying to apply the company’s top client is the one who has purchased the most a discount with 15% discount. One of the requirement before creating this trigger is that - should not hardcode the top client since the top client could change when more purchases are made by other clients. I have created a trigger called TOP_CLIENT and edited the code as below:
AFTER UPDATE ON PURCHASE
BEGIN
SELECT PURCHASENO FROM PURCHASE
WHERE (SELECT MAX(AMOUNT) FROM PURCHASE P
JOIN CLIENT C ON P.PURCHASENO = C.CLIENTNO);
UPDATE PURCHASE
SET AMOUNT = (AMOUNT * 0.85)
END;
/
NOTE THAT: The table CLIENT and PURCHASE are already created and existed in the database.
Shown errors within this code: enter image description here
Please comment if any of the above doesn't make sense or have any questions related! Thank you!