create table frontend_employee(
employee_id int primary key,
employee_name varchar(50),
employee_role varchar(50),
employee_sarlary int default 25000,
employee_boss_id int unique,
foreign key(employee_boss_id) references frontend_boss(boss_id)
);
as you can see I haven't given any ID to that UNIQUE constraint for giving ID to that constraint I should have used another method which is
create table frontend_employee(
employee_id int primary key,
employee_name varchar(50),
employee_role varchar(50),
employee_sarlary int default 25000,
employee_boss_id int,
CONSTRAINT UC_employee UNIQUE (employee_boss_id),
foreign key(employee_boss_id) references frontend_boss(boss_id)
);
I have tried every method present on Google but all are them need a NAME of the constraint but i haven't given any name to the UNIQUE constraint I can not find any method to remove that UNIQUE constraint from that column
Query present on the internet:-
ALTER TABLE table_name DROP CONSTRAINT unique_constraint;
In your case you can't drop only the unique constraint because it is needed in a foreign key constraint. You have to drop the foreign key constraint as well.
Consider the following data example
The unique constraint has the autogenerated name
employee_boss_idTo drop
Drop unique constraint and the foreign key