Skip to content

Commit

Permalink
add repo link
Browse files Browse the repository at this point in the history
  • Loading branch information
memcmahon committed Nov 4, 2024
1 parent e253c11 commit dcda579
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module4/lessons/grouping_aggregating.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ While we are talking about functions built in to Postgresql, it is important to

### SQL Aggregates

We'll be working with Set List on the `many-to-many-complete` branch. Let's run `rails dbconsole` in SetList to open up a connection to our Postgres Database. Let's find the average length of all songs:
We'll be working with [Set List](https://github.com/turingschool-examples/set-list-api/tree/many-to-many-complete) on the `many-to-many-complete` branch. Let's run `rails dbconsole` in SetList to open up a connection to our Postgres Database. Let's find the average length of all songs:

```sql
select avg(length) from songs;
Expand Down Expand Up @@ -63,7 +63,7 @@ select max(length) from songs;

ActiveRecord gives us corresponding "calculations" for those aggregate functions. Take a minute to look through the [ActiveRecord Calculations Docs](https://api.rubyonrails.org/classes/ActiveRecord/Calculations.html) to see what calculations are available.

Let's open up a Rails console and look at the ActiveRecord syntax for the above examples:
Let's open up Rails console with `$ rails console` and look at the ActiveRecord syntax for the above examples:

```ruby
Song.average(:length)
Expand Down

0 comments on commit dcda579

Please sign in to comment.