Skip to content

Commit 58c6f5d

Browse files
Update Intermediate Problems.md
1 parent cd97cb8 commit 58c6f5d

File tree

1 file changed

+17
-73
lines changed

1 file changed

+17
-73
lines changed

Intermediate Problems.md

+17-73
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ORDER BY TotalProducts DESC
2828

2929
**21. In the Customers table, show the total number of customers per Country and City.**
3030
```SQL
31-
SELECT
31+
SELECT TOP(10)
3232
Country,
3333
City,
3434
COUNT(CustomerID) AS TotalCustomers
@@ -38,77 +38,21 @@ ORDER BY TotalCustomers DESC
3838
```
3939
**Result:**
4040

41-
| Country | City | TotalCustomers |
42-
|-------------|-----------------|----------------|
43-
| UK | London | 6 |
44-
| Mexico | México D.F. | 5 |
45-
| Brazil | Sao Paulo | 4 |
46-
| Brazil | Rio de Janeiro | 3 |
47-
| Spain | Madrid | 3 |
48-
| Argentina | Buenos Aires | 3 |
49-
| France | Paris | 2 |
50-
| USA | Portland | 2 |
51-
| France | Nantes | 2 |
52-
| Portugal | Lisboa | 2 |
53-
| Finland | Oulu | 1 |
54-
| Italy | Reggio Emilia | 1 |
55-
| France | Reims | 1 |
56-
| Brazil | Resende | 1 |
57-
| Austria | Salzburg | 1 |
58-
| Venezuela | San Cristóbal | 1 |
59-
| USA | San Francisco | 1 |
60-
| USA | Seattle | 1 |
61-
| Spain | Sevilla | 1 |
62-
| Norway | Stavern | 1 |
63-
| France | Strasbourg | 1 |
64-
| Germany | Stuttgart | 1 |
65-
| Italy | Torino | 1 |
66-
| France | Toulouse | 1 |
67-
| Canada | Tsawassen | 1 |
68-
| Canada | Vancouver | 1 |
69-
| France | Versailles | 1 |
70-
| USA | Walla Walla | 1 |
71-
| Poland | Warszawa | 1 |
72-
| USA | Butte | 1 |
73-
| Brazil | Campinas | 1 |
74-
| Venezuela | Caracas | 1 |
75-
| Belgium | Charleroi | 1 |
76-
| Ireland | Cork | 1 |
77-
| UK | Cowes | 1 |
78-
| Germany | Cunewalde | 1 |
79-
| USA | Elgin | 1 |
80-
| USA | Eugene | 1 |
81-
| Germany | Frankfurt a.M. | 1 |
82-
| Switzerland | Genève | 1 |
83-
| Austria | Graz | 1 |
84-
| Finland | Helsinki | 1 |
85-
| Venezuela | I. de Margarita | 1 |
86-
| USA | Kirkland | 1 |
87-
| Denmark | Kobenhavn | 1 |
88-
| Germany | Köln | 1 |
89-
| USA | Lander | 1 |
90-
| Germany | Leipzig | 1 |
91-
| France | Lille | 1 |
92-
| Germany | Mannheim | 1 |
93-
| France | Marseille | 1 |
94-
| Sweden | Luleå | 1 |
95-
| France | Lyon | 1 |
96-
| Canada | Montréal | 1 |
97-
| Germany | München | 1 |
98-
| Germany | Münster | 1 |
99-
| Germany | Aachen | 1 |
100-
| USA | Albuquerque | 1 |
101-
| USA | Anchorage | 1 |
102-
| Denmark | Århus | 1 |
103-
| Spain | Barcelona | 1 |
104-
| Venezuela | Barquisimeto | 1 |
105-
| Italy | Bergamo | 1 |
106-
| Germany | Berlin | 1 |
107-
| Switzerland | Bern | 1 |
108-
| USA | Boise | 1 |
109-
| Sweden | Bräcke | 1 |
110-
| Germany | Brandenburg | 1 |
111-
| Belgium | Bruxelles | 1 |
41+
- 69 rows were affeted, showing only the top 10
42+
43+
| Country | City | TotalCustomers |
44+
|-----------|----------------|----------------|
45+
| UK | London | 6 |
46+
| Mexico | México D.F. | 5 |
47+
| Brazil | Sao Paulo | 4 |
48+
| Argentina | Buenos Aires | 3 |
49+
| Spain | Madrid | 3 |
50+
| Brazil | Rio de Janeiro | 3 |
51+
| Portugal | Lisboa | 2 |
52+
| France | Nantes | 2 |
53+
| France | Paris | 2 |
54+
| USA | Portland | 2 |
55+
11256

11357
**22. What products do we have in our inventory that should be reordered? Order the results by ProductID.**
11458
```SQL
@@ -300,7 +244,7 @@ ORDER BY o.OrderID, d.ProductID
300244
```
301245
**Result:**
302246

303-
2155 rows were affeted, showing only the top 10
247+
- 2155 rows were affeted, showing only the top 10
304248

305249
| EmployeeID | LastName | OrderID | ProductName | Quantity |
306250
|------------|-----------|---------|----------------------------------|----------|

0 commit comments

Comments
 (0)