Need help in calculating! First of all, I have a database called db1.mdf that has " table1" and has a column for "fuelqty" , "cost"and "Mileage" (number of of mileage). I need to implement the specified data analysis capabilities (cost per mile, and miles per gallon) using SQL queries to retrieve the data from the database. I was told that I should use the following:
(last_fuel_odometer – starting_odometer) / (total_fuel_used) for calculating average miles per gallon and
Total_operating_cost / (current_odometer – starting_odometer) for cost per mile.
Now, not knowing much about SQL (actually 0), what is the best way to approch this. If anyone has a sample code I would greatly appreciate this. I have finals next week and I'm sure this will come up.
Thanks!!!
(last_fuel_odometer – starting_odometer) / (total_fuel_used) for calculating average miles per gallon and
Total_operating_cost / (current_odometer – starting_odometer) for cost per mile.
Now, not knowing much about SQL (actually 0), what is the best way to approch this. If anyone has a sample code I would greatly appreciate this. I have finals next week and I'm sure this will come up.
Thanks!!!