Home > Workload Solutions > Data Analytics > Guides > Enable Hybrid Analytics with Dell ECS and Snowflake > Use case 1: SQL query
The following SQL query was used to build the Power BI Dashboard. The script populates the ext_nyc_tripdata table with the data for the Power BI dashboard. This data is sourced from existing object data located in the external_s3 bucket on ECS.
select t.range, count(*) as "Number of Occurrences", ROUND(AVG(fare_amount),2) as "Avg",
ROUND(MAX(fare_amount),2) as "Max" ,ROUND(MIN(fare_amount),2) as "Min"
FROM (
select
case
when trip_distance between 0 and 9 then ' 0-9 '
when trip_distance between 10 and 19 then '10-19'
when trip_distance between 20 and 29 then '20-29'
when trip_distance between 30 and 39 then '30-39'
else '> 39'
end as range ,fare_amount
FROM ext_nyc_tripdata ) t
where fare_amount > 1 and fare_amount < 401092
group by t.range;