SELECT CLAUSE
RETURN all the products
name
unit price
new price(unit price * 1.1)
the solution for the above question is,
SELECT name, unit_price, unit_price * 1.1 AS new_price
FROM products
prints,
name | unit_price | new_price |
---|
Brocolinni - Gaylan, Chinese | 4.53 | 4.983 |
---|---|---|
Broom - Push | 1.09 | 1.199 |
Foam Dinner Plate | 1.21 | 1.331 |
Island Oasis - Raspberry | 0.74 | 0.814 |
Lettuce - Romaine, Heart | 3.35 | 3.685 |
Longan | 2.26 | 2.486 |
Petit Baguette | 2.39 | 2.629 |
Pork - Bacon,back Peameal | 4.65 | 5.115 |
Sauce - Ranch Dressing | 1.63 | 1.793 |
Sweet Pea Sprouts | 3.29 | 3.619 |
WHERE CLAUSE
Get the orders placed this year
solution,
SELECT *
FROM orders
WHERE order_date >= '2019-01-01'
prints, (only 01 order was placed)
order_id | customer_id | order_date | status |
---|---|---|---|
1 | 6 | 2019-01-30 | 1 |
The AND, OR and NOT operator
From the order_items table, get the items
for order #6
where the total price is greater than 30
solution,