External Exam Download Resources Web Applications Games Recycle Bin

Arithmetic Operators

operations1.sql

SELECT title, price / 2 AS "half price"
FROM menu

operations2.sql

SELECT title, ROUND(price + (price * 0.1),2) AS "Price with GST"
FROM menu

operations3.sql

SELECT title, calories - 200 AS "Calories with low-carb cheese"
FROM menu
WHERE description LIKE "%cheese%"
  1. Everything is $5 off! work out a list of the new prices.
  2. Challenge - work out the next available number in the num field (for example, incase i wanted to add a new menu item - what would be the next available number? your query should display the result 14, given that there are currently 13 items)