int, `Mention_country` varchar (20)) BEGIN WITH CTE as (select year(paymentDate) as `Year`, country , amount from customers c join payments p on c.customerNumber = p.customerNumber) select `Year` , country, concat(round(sum(amount)/1000),"K") as TotalAmount from CTE group by `Year`, country having `Year` = `Mention_Year` and country = `Mention_Country`; END
3.Trigger
CREATE DEFINER=`root`@`localhost` TRIGGER `emp_bit_BEFORE_INSERT` BEFORE INSERT ON
`emp_bit` FOR EACH ROW BEGIN If New.Working_Hours <0 then set New.Working_Hours = -(new.working_Hours); End if; END