I have two tables. Employee & department.
employee[emp_id, emp_name, Department_id, emp_address]
Department_id in employee table has been defined as a foreign key on Department.department_id
and Null values are allowed.
I am trying to alter employee table to alter department_id NOT NULL using below query.
ALTER TABLE Employee
Add Department_ID NOT NULL INTEGER
I am getting an error that "Foreign key column Department_ID can not be modified."
Can I not modify foreign key column in referncing table? If Yes how?
Also,the column type that you are trying to change to NOT NULL if it is indexed then the attributes can not be altered.For non-indexed column defined as NULL can be altered to NOT NULL provided that the column does not contain nulls.