|CREATE TABLE Enrolled(
PRIMARY KEY (sid,cid),
FOREIGN KEY (sid)
ON DELETE CASCADE
ON UPDATE SET DEFAULT )
Does the delete cascade on update set default just mean if a student is deleted, i.e. that sid no longer exists, i want all enrolled tuples to change the value of the sid fk to some default value? if that's the case, what is the default value? is default special like null?
is it possible to have that delete and update constraint in the students table or can it only be used with foreign keys? in other words, can i create a constraint in the students table where i update sid values of all enrolled tuples if a student is deleted.
also, just to double check:
|constraint sid_fk foreign key (sid) references student|
just mean i'm naming the constraint sid_fk and defining to be that the value of the sid must intersect with at least one primary key value in the student table?
same as saying:
foreign key(sid_fk) references student
except we aren't naming the constraint, the dbms is?