Skip to content

Commit d755cad

Browse files
feat: solved 3rd stage of the Hyperskill project "Electronics Store Customer"
1 parent f58e869 commit d755cad

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

hyperskill/16_electronics_store_customer/02/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Round the result up to 2 decimal places.
66

77
```sql
88
SELECT ROUND(AVG(price), 2) AS avg_price
9-
FROM Printer
10-
WHERE color = 'C'
11-
AND type = 'Inkjet';
9+
FROM Printer
10+
WHERE color = 'C' AND type = 'Inkjet';
1211
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Objectives
2+
3+
Identify the total price of all laptop models produced by each maker.
4+
5+
Find the maker in the `Product` table and `SUM` of the prices in Laptop as `total_price`.
6+
7+
Ensure the results are sorted by `total_price` in ascending order. Use `GROUP_BY` and `SUM` functions to solve this.
8+
9+
```sql
10+
SELECT maker, SUM(price) AS total_price
11+
FROM Product JOIN Laptop ON Product.model = Laptop.model
12+
GROUP BY maker
13+
ORDER BY total_price ASC;
14+
```

0 commit comments

Comments
 (0)