Parcourir la source

finished exercises 1-3, start ex4

master
Ernest Debruyne il y a 2 ans
Parent
révision
afca07ed69
1 fichiers modifiés avec 19 ajouts et 0 suppressions
  1. 19
    0
      How-to-code-subqueries.sql

+ 19
- 0
How-to-code-subqueries.sql Voir le fichier

@@ -1,14 +1,33 @@
-- Exercise 1

SELECT DISTINCT category_name
FROM categories
WHERE category_id IN (SELECT category_id
FROM products)
ORDER BY category_name;

-- Exercise 2

SELECT product_name,
list_price
FROM products
WHERE list_price > (SELECT AVG(list_price)
FROM products)
ORDER BY list_price DESC;

-- Exercise 3

SELECT category_name
FROM categories
WHERE NOT EXISTS (SELECT *
FROM products
WHERE category_id = categories.category_id);

-- Exercise 4

SELECT email_address,
order_id,

-- Exercise 4 Part 2


Chargement…
Annuler
Enregistrer