create table emp
(
emp_id int,
emp_name varchar(40) not null,
emp_address varchar(35) not null,
)
Now I need to add primary key to emp_id . I tried using alter query
alter table emp add constraint emp_id primary key
its showing error as
Table level constraint does not specify column list, table 'emp'.
ALTER TABLE emp
ADD PRIMARY KEY (emp_id)
OR
ALTER TABLE emp
ADD CONSTRAINT pk_empID PRIMARY KEY (emp_id)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With