Rolling Average with Oracle analytical functions

This little example will demonstrate how to use Oracle's analytical functions to get the rolling average.
First you have to create and load a table that contains
each month's average temprature in Edinburgh in the years 1764-1820. The script to do that can
be found here.

After filling this table, use this statement to find the average temperature over the last 12 Months for each month in
the result set:

select
avg_temp,
month, year,
to_char(avg(avg_temp)
OVER (order by year,month rows between 11 preceding and current row),
'99D9')
as avg_year_temp from scottish_weather;