The idea of homework is to get you to think about what you have learned, and to teach you to use it in "practical" situations - as well as to check how good your comprehension has been so that remedial action can be taken if necessary. That's why you aren't allowed to use VAR - it's too simple a solution and teaches you nothing about SQL queries.
So, as Richard has said, look at how you calculate a variance, and try to implement it yourself.
If you are having problems getting started at all, then this may help:
How to Write Code to Solve a Problem, A Beginner's Guide[
^]