File tree 2 files changed +16
-3
lines changed
hyperskill/16_electronics_store_customer
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ Round the result up to 2 decimal places.
6
6
7
7
``` sql
8
8
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' ;
12
11
```
Original file line number Diff line number Diff line change
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
+ ```
You can’t perform that action at this time.
0 commit comments