Which of the following query from 'INVENTORY' relation will work for calculating 18% GST rounded to one decimal place for the 'Price' column?
Which of the following query from 'INVENTORY' relation will work for calculating 18% GST rounded to one decimal place for the 'Price' column?
Solution
18% GST on a price is . The function ROUND(x, n) rounds to decimal places, so gives one decimal place.
SELECT ROUND(Price * 0.18, 1) FROM INVENTORY; does both: it finds the GST amount and rounds it to one decimal place.
Option 1: the second argument is 0, so it rounds to a whole number, not one decimal place.
Option 2: the GST is correct, but there is no ROUND, so the result is not limited to one decimal place.
Option 3: it multiplies by 18 instead of 0.18, so the amount is 100 times too large.
Related questions:
2025: 21 May Shift 1
2026: 31 May Shift 1
2026: 29 May Shift 2
2025: 30 May Shift 2
2026: 21 May Shift 1