I have a database, I used these commands :
CREATE TABLE APPOINTMENT (app_id INT(5) NOT NULL, app_doctor INT(5) NOT NULL, app_date DATE, PRIMARY KEY (app_id));
CREATE TABLE APPPATIENTS (patient_ssn INT(10) NOT NULL, patient_name VARCHAR(20) NOT NULL, sex CHAR(1) NOT NULL, appointment_id INT(5), PRIMARY KEY (patient_ssn), UNIQUE (appointment_id));
ALTER TABLE APPPATIENTS ADD FOREIGN KEY (appointment_id) REFERENCES APPOINTMENT(app_id) ON DELETE CASCADE;
Now, I want to delete foreign key appointment_id in appPatients table :
ALTER TABLE apppatients DROP FOREIGN KEY appointment_id;
But I got an error :
Can't drop 'appointment_id'; check that column/key exists.
It is there! How can it give that error? What am I doing wrong?