Lawyer - General term for the next three
Barrister - The legal specialists who give specialist opinions ('counsel's opinion') and who generally appear in higher courts
Solicitor - The public face of the profession (you need to go through a solicitor to get in touch with a barrister), can appear in lower courts, typically does mundane legal stuff like advice, conveyancing and wills
Solicitor-advocate - A solicitor who's also qualified to appear in higher courts, so can argue cases like a barrister can
Advocate - This wasn't covered in my Law AS, but I think it's the Scottish version of a barrister
Magistrate - The lowest level of judge, deals with fairly minor cases, doesn't have to be legally qualified
Judge - A (possibly former) senoir barrister or solicitor who judges more complex cases