I have two tables
Table A:
ID 1 2 3 4
Table B:
ID 1 2 3
I have two requests:
select ID from A where ID not in (select ID from B);
or
select ID from A except select ID from B;
Your second question:
delete from A where ID not in (select ID from B);