Firstly i would suggest googling everything you need to know (Seems to work well for me at least)
If you want to count referrals you could use 'count', something like this:
Code:
SELECT Referral, Record_Count=Count(*)
FROM Table1
GROUP BY Referral
Or
Code:
SELECT
Count_1=(SELECT Count(*) FROM Table1 WHERE Referral = 1),
Count_2=(SELECT Count(*) FROM Table1 WHERE Referral = 2)
My honest opinion would be to search the net for simple explanations on how to use certain functions something like:
http://www.w3schools.com/sql/default.asp
And then build on a basic query with whatever else you want to add.
Worst comes to worse you can copy whatever SQL code you have, table names and column names... and someone here will probably have the answer for you.
Good luck.
Rixxe