Skip to content

Commit 8067724

Browse files
authored
Merge pull request #47 from Meg528/patch-29
Update 2-sql-vs-aggregation.mdx
2 parents b844c82 + fb2144a commit 8067724

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/20-what-is-aggregation/2-sql-vs-aggregation.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ JOIN (
2828

2929
```
3030

31-
### Get annual, average and max spending from customers in all cities
31+
### Get annual, average, and max spending from customers in all cities
3232

3333
```SQL
3434
SELECT
@@ -58,11 +58,11 @@ GROUP BY city;
5858

5959
### Get authors’ bios with books that have an average 5-star rating
6060

61-
We o through 4 stages:
62-
- group all the reviews for every book, calculating the average rating.
63-
- filter out all average ratings other than 5.
64-
- now we have reviews with 5 stars, but we also want the author bio, so we join with author to get the bio.
65-
- we add a new field called `bio` with just the author's bio.
61+
We go through four stages:
62+
- Group all the reviews for every book, calculating the average rating.
63+
- Filter out all average ratings other than 5.
64+
- Now we have reviews with 5 stars, but we also want the author bio, so we join with author to get the bio.
65+
- We add a new field called `bio` with just the author's bio.
6666

6767
```js
6868
db.reviews.aggregate([
@@ -91,7 +91,7 @@ db.reviews.aggregate([
9191
```
9292

9393

94-
### Get annual, average and max spending from customers in all cities
94+
### Get annual, average, and max spending from customers in all cities
9595

9696
Here we pass three stages: one to return one document per element in the `address` array, and then we filter out to get only the documents that have a `home` address location. Finally, we do the grouping. As we'll see, this can be split and tested separately and resembles our code.
9797

0 commit comments

Comments
 (0)