Homework #5 FAQ
I want to delete a constraint but I did not give it a name when I
created it. What should I do?
If you try to insert into the relation a tuple that violates
the constraint, the constraint name will be returned. For example,
SQL> ALTER TABLE Distribution ADD CHECK (distname LIKE '%SUN%');
SQL> INSERT INTO Distribution VALUES ('Linux', '6.2');
INSERT INTO Distribution VALUES ('Linux', '6.2')
ERROR at line 1:
ORA-02290: check constraint (DBRUMLEY.SYS_C0026886) violated
SQL> ALTER TABLE Distribution DROP CONSTRAINT SYS_C0026886;
The constraint name in this case is returned as SYS_C0026886.
Thanks to David Brumley for pointing this out.
In problem 1(b), what does a "future year" mean?
It means any year later than the year the book was published.
Should I consider books of the same name but different year as different books?
Do we need to worry about update of a review to score 10, or deletion of
a review of score 10?
No, you don't have to. Only new reviews (insertions) need to be considered.