select
passenger_count,
avg(tip_amount) filter (
where
tip_amount > 5
)
from
nyc_yellow_taxi_0601_0615_2016
where
pickup_datetime between '2016-06-10 15:00:00'
and '2016-06-10 15:05:00'
group by
passenger_count
select
passenger_count,
avg(tip_amount) filter (
where
tip_amount > 5
),
count(ogc_fid)
from
nyc_yellow_taxi_0601_0615_2016
where
pickup_datetime between '2016-06-10 15:00:00'
and '2016-06-10 15:05:00'
and count(ogc_fid) > 50
group by
passenger_count
select
passenger_count,
avg(tip_amount) filter (
where
tip_amount > 5
),
count(ogc_fid)
from
nyc_yellow_taxi_0601_0615_2016
where
pickup_datetime between '2016-06-10 15:00:00'
and '2016-06-10 15:05:00'
group by
passenger_count
having
count(ogc_fid) > 50
select
passenger_count,
tip_amount
from
nyc_yellow_taxi_0601_0615_2016
where
pickup_datetime between '2016-06-10 15:00:00'
and '2016-06-10 15:05:00'
order by
tip_amount desc
limit
5
select
nta_name,
count(ogc_fid)
from
nyc_2015_tree_census
where
spc_common like '%maple%'
group by
nta_name
order by
count(ogc_fid) desc
limit
5 offset 5