, "" ", ", - . , ( , , , ) - (U, P) , " U P". , ( , , , , , , ).
SQL , ?
: SQL, ( InnoDb, mysql), , uid pid :
create table Seen (uid int, pid int,
foreign key uid references user(uid) on delete cascade,
foreign key pid references project(pid) on delete cascade,
primary key (uid, pid))
pid P , "", delete from Seen where pid=P (.. P ); U, U , and uid!=U where delete.
, U P, insert ignore into Seen(uid, pid) values (U, P) ( ignore " , ", "" , , , ).