Chapter Seven – SQL For Database Construction and Application Processing
Page 7-35
For Oracle Database: Note that Oracle Database supports ON DELETE CASCADE, but does
not support ON UPDATE CASCADE. Therefore, we cannot cascade updates from PROJECT to
ASSIGNMENT in Oracle Database. Further, Oracle Database does not support the NO ACTION
clause in ON DELETE—since this is the default, Oracle Database simply expects you to only
state ON DELETE CASCADE when this is the desired action. Finally, Oracle Database does not
allow the NOT NULL phrase to be used with DEFAULT—You can use one or the other, but not
both at the same time. Finally, Oracle Database uses SEQUENCES to set surrogate keys.
CREATE TABLE EMPLOYEE(
EmployeeNumber Int NOT NULL,
FirstName Char(25) NOT NULL,
LastName Char(25) NOT NULL,
CREATE SEQUENCE seqEID Increment by 1 Start with 1;
For MySQL: MySQL uses AUTO_INCREMENT to set surrogate keys, but can only use an
increment of 1.
CREATE TABLE EMPLOYEE(
EmployeeNumber Int NOT NULL AUTO_INCREMENT,
FirstName Char(25) NOT NULL,
LastName Char(25) NOT NULL,
ALTER TABLE EMPLOYEE AUTO_INCREMENT=1;