Recap - Join
Coddy'nin SQL Journey'sinin Temeller bölümünün bir parçası — ders 45 / 72.
Görev
OrtaKullanılabilir tablolar ve sütunlar:
<strong>orders</strong>:<strong>id</strong>,<strong>customer_id</strong><strong>products</strong>:<strong>id</strong>,<strong>unit_price</strong>,<strong>units_in_stock</strong><strong>order_items</strong>:<strong>id</strong>,<strong>order_id</strong>,<strong>product_id</strong>,<strong>quantity</strong>
Birim fiyatı 10'dan küçük olan ürünleri sipariş eden müşterilerin müşteri kimliklerini (customer_id) bulun ve her bir müşterinin sipariş ettiği bu ucuz ürünlerin toplam miktarını listeleyin.
Aşağıdaki sütunları döndürün:
- customer_id
- total_quantity (her bir müşteri için birim fiyatı < 10 olan ürünlerin miktarlarının toplamı)
Kendin dene
-- Gruplama sütununu ve görevin istediği toplulaştırılmış değeri listele
SELECT ____
FROM orders
-- Her join, bir id sütununu ona işaret eden sütunla eşleştiren bir koşul gerektirir
INNER JOIN order_items ON ____
INNER JOIN products ON ____
-- Ardından yalnızca görevin tanımladığı eşiği karşılayan satırları tut
WHERE ____
GROUP BY orders.customer_id;Temeller bölümündeki tüm dersler
4More Keywords
The IN keywordThe BETWEEN keywordThe LIKE keywordThe AS keywordRecap - Cellphone Models2Conditions
Conditions BasicsThe AND keywordThe OR keywordThe NOT keywordMultiple Conditions CombinedParenthesisBooleans5Arithmetic Operations
Mathematical OperatorsMathematical ColumnsThe Modulo OperationThe ROUND() Function3Specific Return Format
Null valuesSort Results Part 1Sort Results Part 2Recap - Cyber Security FirmLimit number of recordsRecap - Vehicle Factory6Intro Challenges
Recap - Parliamentary ElectionRecap - Police Criminal ArrestRecap - Bar Beverage ContainerRecap - Engineer new columns