Skip to content

Commit a99d175

Browse files
authored
Update 05-aggregating-calculating.md
1 parent 8301245 commit a99d175

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

_episodes/05-aggregating-calculating.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ ORDER BY AVG(Citation_Count) DESC;
3939
{: .sql}
4040

4141
> ## Challenge
42-
> Write a query using an aggregate function that returns the number of article titles per ISSNs, sorted by title count in descending order. Which ISSN has the most titles? (Hint to choosing which aggregate function to use - it is one of the common aggreggate functions `MAX, MIN, AVG, COUNT, SUM`.)
42+
> Write a query using an aggregate function that returns the number of article titles per ISSNs, sorted by title count in descending order. Which ISSN has the most titles? (Hint to choosing which aggregate function to use - it is one of the common aggregate functions `MAX, MIN, AVG, COUNT, SUM`.)
4343
>
4444
> > ## Solution
4545
> > ~~~
4646
> > SELECT ISSNs, COUNT(Title)
4747
> > FROM articles
4848
> > GROUP BY ISSNs
49-
> > ORDER BY count(Title) DESC;
49+
> > ORDER BY COUNT(Title) DESC;
5050
> > ~~~
5151
> > {: .sql}
5252
> {: .solution}
@@ -98,6 +98,6 @@ ORDER BY Author_Count -1 DESC;
9898
9999
In section [6. Joins and aliases](https://librarycarpentry.org/lc-sql/06-joins-aliases/index.html) we are going to learn more about the SQL keyword `AS` and how to make use of aliases - in this example we simply used the calculation and `AS` to represent that the new column is different from the original SQL table data.
100100
101-
We can use any arithmetic operators (like `+`, `-`, `*`, `/`, square root `SQLRT` or the modulo operator `%`) if we would like.
101+
We can use any arithmetic operators (like `+`, `-`, `*`, `/`, square root `SQRT` or the modulo operator `%`) if we would like.
102102
103103
If you would like to learn more about calculated values, the Software Carpentry Databases and SQL lesson includes a useful episode on [Calculating New Values](https://swcarpentry.github.io/sql-novice-survey/04-calc/index.html).

0 commit comments

Comments
 (0)