Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: iking 1997 1998 Smith [email protected] Rowing 1998 Why can’t we do the following? can’ INSERT INTO Chicken VALUES (1, 2); INSERT INTO Egg VALUES (2, 1); 71 72 Oracle Solution CREATE TABLE Chicken (cID eID CREATE TABLE Egg (eID cID Oracle Solution (continued) INTEGER PRIMARY KEY, INTEGER); INTEGER PRIMARY KEY, INTEGER); To delete these tables: ALTER TABLE Egg DROP CONSTRAINT EggRefChicken; EggRefChicken; ALTER TABLE Chicken DROP CONSTRAINT ChickenRefEgg; ChickenRefEgg; ALTER TABLE Chicken ADD CONSTRAINT ChickenRefEgg FOREIGN KEY (eID) REFERENCES Egg (eID) (eID) (eID) INITIALLY DEFERRED DEFERRABLE; ALTER TABLE Egg ADD CONSTRAINT EggRefChicken FOREIGN KEY (cID) REFERENCES Chicken (cID) (cID) (cID) INITIALLY DEFERRED DEFERRABLE; DROP TABLE Egg; DROP TABLE Chicken; 73 73 Triggers 74 Trigger Description Event: change to d.b. that activates trigger d.b. Condition: query or test that is run when trigger is activated Action: procedure executed when trigger is...
View Full Document

This note was uploaded on 10/15/2012 for the course CSE 4503 taught by Professor Edallen during the Fall '12 term at Mississippi State.

Ask a homework question - tutors are online