Data exploration and analysis
Let’s do some exploration and analysis on our gps-data2
table.
Assets with the highest ODOMETER
readings:
#find assets (vehicles) with highest amount of miles SELECT asset, assetnhood, MAX(odometer) as odometer FROM `ch12.gps-data2` GROUP BY asset, assetnhood ORDER BY odometer desc
https://tinyurl.com/557zt6px
As displayed in the following screenshot, the preceding query displays the assets or vehicles with the highest odometer readings. This can be used to inform the business of vehicles reaching their end of life or requiring maintenance.
Figure 12.11 – Query results finding vehicles with the most miles
Assets with the longest trips (DISTANCE_TRAVELED
):
#find longest trips per assets SELECT asset, MAX(distance_traveled) as longest_trip FROM `ch12.gps-data2` GROUP BY asset, distance_traveled ORDER BY distance_traveled DESC
https://tinyurl.com/2peyv773
The preceding query finds the longest...