title: how do i cascade updates and deletions in oracle?
body: <p>I'm trying to follow the examples in my book to cascade updates and deletions but the problem is their syntax doesnt work in oracle DB..</p>
  
  <p>I understand to cascade an update would mean an update to a parent would also update its child and same with deletions.. but i cant figure out the syntax for oracle.. the specific questions from my book are:</p>
  
  <p><strong>7.5 -- Write a CREATE TABLE statement for the EMPLOYEE table. Email is 
  required and is an alternate key, and the default value of Department is 
  Human Resources. Cascade updates but not deletions from DEPARTMENT to EMPLOYEE.</strong></p>
  
  <p><strong>7.6 -- Write a CREATE TABLE statement for PROJECT table. The default value for 
  MaxHours is 100.  Cascade updates but not deletions from DEPARTMENT to EMPLOYEE.</strong> </p>
  
  <p><strong>7.7 -- Write a CREATE TABLE statement for the ASSIGNMENT table. Cascade only 
  deletions from PROJECT to ASSIGNMENT; do not cascade either deletions or 
  updates from EMPLOYEE to ASSIGNMENT.</strong></p>
  
  <p>I finally managed to successfully created these tables in iSQL *Plus with this Query:</p>
  
  <pre><code>CREATE TABLE DEPARTMENT (
  DepartmentName  char(35) NOT NULL,
  BudgetCode      char(30) NOT NULL,
  OfficeNumber    char(15) NOT NULL,
  Phone           char(12) NOT NULL,
  
  Constraint DepartmentPK PRIMARY KEY(DepartmentName)
  
  );
  
  INSERT INTO DEPARTMENT VALUES (
      'Administration', 'BC-100-10', 'BLDG01-300', '360-285-8100');
  
  CREATE TABLE EMPLOYEE (
  EmployeeNumber  int         NOT NULL,
  FirstName       char(25)    NOT NULL,
  LastName        char(25)    NOT NULL,
  Department      char(35)    DEFAULT 'Human Resources' NOT NULL,
  Phone           char(12)    NULL,
  Email           char(30)    NOT NULL,
  DepartmentName_FK char(35) NOT NULL,
  
  Constraint EmployeePK   PRIMARY KEY(EmployeeNumber),
  Constraint EmployeeAK1 UNIQUE(Email),
  Constraint DepartmentFK FOREIGN KEY (DepartmentName_FK)
      references DEPARTMENT(DepartmentName)
  --ON UPDATE CASCADE 
  --ON DELETE no ACTION 
  
  );
  
  CREATE TABLE PROJECT (
  ProjectID   int         NOT NULL,
  Name        char(30)    NOT NULL,
  Department1 char(15)    NOT NULL,
  MaxHours    int         DEFAULT 100 NOT NULL,
  StartDate   DATE        NULL,
  EndDate     DATE        NULL,
  DepartmentName_FK1 char(30)   NULL,
  
  
  Constraint  datecheck check (StartDate &lt; EndDate),
  Constraint ProjectIDPK   PRIMARY KEY(ProjectID),
  Constraint DepartmentFK1 FOREIGN KEY (DepartmentName_FK1)
      references DEPARTMENT(DepartmentName)
  -- ON UPDATE CASCADE 
  -- ON DELETE no ACTION 
  );
  
  CREATE TABLE Assignment(
  ProjectID       Number      NOT NULL,
  EmployeeNumber  Number      NOT NULL,
  HoursWorked     Number      NULL,
  
  Constraint ProjectIDEmpNumPK PRIMARY KEY(ProjectID, EmployeeNumber),
  
  constraint ProjectIDFK FOREIGN KEY(ProjectID)
      references Project(ProjectID),
  constraint EmpNumFK FOREIGN KEY(EmployeeNumber)
      references Employee(EmployeeNumber)
  --CONSTRAINT UniqueEmployee UNIQUE (EmployeNumber)
  
  --ON DELETE CASCADE 
  );
  </code></pre>
  
  <p>but how do I specify cascading delete and update and specify not to?</p>