select * from class a left join course b on a.cid=b.coid where b.coid is null
union
select * from class a right join course b on a.cid=b.coid where a.cid is null
select * from class a left join course b on a.cid=b.coid where b.coid is null
union
select * from class a right join course b on a.cid=b.coid where a.cid is null