it should work. What error message appears?
there is a lot of ways of doing it, for example:
-having both department and job fields
job like '%teacher%' and department <> 'math'
job like '%teacher%' and department != 'math'
job like '%teacher%' and department NOT like '%math%'
this just will take "language teacher", "science teacher", but no "math teacher".
an advice is to put your querys in the mySQL command-line client (if you have the chance to) or in the phpmyadmin SQL textarea in order to check if they work before writting any php code.