User-Defined Function: Tax Amount
Medium
Views, Procedures & Triggers
Create a function tax_amount(amount) that returns 5% of the amount when the amount is at most 1000 and 10% otherwise, rounded to two decimals. Then show its result for 800 and 2000.
Table schema
No tables are required.Sample data
SELECT tax_amount(800), tax_amount(2000);
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.