update Classes as C
set Valid = 0
where not C.Class = any (select  RoomCat from Rooms  R where  R.RoomCat = C.Class )
