0

I'm just learning sql and I'm running into some errors. Here's my code:

create table EMPLOYEE_tcs
(
    SSN_Number char(9) Not Null,
    First_Name varchar(15) Not Null,
    Mid_Name char,
    Last_Name varchar(15) Not Null, 
    Birthday Date,
    Address varchar(50),
    Gender Char Check(gender = 'M' or gender = 'F' or gender = 'm' or gender = 'f'),
    Salary money Default '80000',
    Supervisor_SSN Char(9), 
    Department_Number Int
    Constraint pk_emp Primary Key (SSN_Number)
    Constraint fk_Supervisor Foreign Key (Supervisor_SSN) EMPLOYEE_tcs (SSN_Number) ON DELETE SET NULL
);

I keep getting the error message:

Introducing FOREIGN KEY constraint 'fk_Supervisor' on table 'EMPLOYEE_tcs' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.

I have no clue what this means and i dont know how to fix it either.

Evaldas Buinauskas
  • 13,739
  • 11
  • 55
  • 107
  • Check this - [Foreign key constraint may cause cycles or multiple cascade paths?](http://stackoverflow.com/questions/851625/foreign-key-constraint-may-cause-cycles-or-multiple-cascade-paths) – Abhishek Nov 02 '15 at 07:31
  • 1
    Please don't tag products not involved. (Are you really using both MySQL and MS SQL Server here?) – jarlh Nov 02 '15 at 08:07

0 Answers0