Skip to content

Commit

Permalink
Cleaned up example queries in README.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan B. Harvey committed Sep 24, 2017
1 parent bd239bd commit 614882c
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,27 @@ Login to the db with psql `psql -h localhost -U nola311` and run some queries:

```sql
-- what are the top issues that people call about?
select issue_type, count(*) as num_calls from nola311.calls group by issue_type order by num_calls desc;
select issue_type, count(*) as num_calls
from nola311.calls
group by issue_type
order by num_calls desc;

-- which council district has the most calls?
select council_district, count(*) as num_calls from nola311.calls group by council_district order by num_calls desc;
select council_district, count(*) as num_calls
from nola311.calls
group by council_district
order by num_calls desc;

-- how many pothole calls have been opened and closed this year?
select ticket_status, count(*) as total from nola311.calls where issue_type = 'Pothole/Roadway Surface Repair' and ticket_created_date_time >= '2017-01-01'::date group by ticket_status;
select ticket_status, count(*) as total
from nola311.calls
where issue_type = 'Pothole/Roadway Surface Repair'
and ticket_created_date_time >= '2017-01-01'::date
group by ticket_status;

--- dont forget to checkout the views

select * from open_tickets_stats where issue_type = 'Catch Basin Maintenance' and year_created = '2017';
select *
from open_tickets_stats
where issue_type = 'Catch Basin Maintenance'
and year_created = '2017';
```

0 comments on commit 614882c

Please sign in to comment.