Skip to content

Commit 67cd16b

Browse files
authored
Update analyze-twitch-data-with-sqlite.mdx
1 parent f9c1107 commit 67cd16b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

projects/analyze-twitch-data-with-sqlite/analyze-twitch-data-with-sqlite.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Let’s find all the unique languages in this dataset using the `DISTINCT` keywo
256256

257257
```
258258
SELECT DISTINCT language
259-
FROM streamers;
259+
FROM streamers2021;
260260
```
261261

262262
The results should look like:
@@ -288,7 +288,7 @@ For `streamers2024` table, you can do distinct games:
288288

289289
```sql
290290
SELECT DISTINCT most_streamed_game
291-
FROM streamers;
291+
FROM streamers2024;
292292
```
293293

294294
- League of Legends
@@ -340,7 +340,7 @@ For this, we can use the `MAX()` function:
340340

341341
```sql
342342
SELECT channel, MAX(followers_gained)
343-
FROM streamers
343+
FROM streamers2021
344344
ORDER BY followers_gained
345345
LIMIT 5;
346346
```
@@ -362,17 +362,17 @@ I just looked up all of them. All of them are still streaming in 2025!
362362
To find out this one, we need to use `COUNT()` and `GROUP BY`:
363363

364364
```
365-
SELECT game, COUNT(*)
366-
FROM stream
367-
GROUP BY game
365+
SELECT most_streamed_game, COUNT(*)
366+
FROM streamers2024
367+
GROUP BY most_streamed_game
368368
ORDER BY COUNT(*) DESC;
369369
```
370370

371371
We can rewrite this using column reference numbers instead of column names:
372372

373373
```
374-
SELECT game, COUNT(*)
375-
FROM stream
374+
SELECT most_streamed_game, COUNT(*)
375+
FROM streamers2024
376376
GROUP BY 1
377377
ORDER BY 2 DESC;
378378
```

0 commit comments

Comments
 (0)