can we create a primary key on duplicate column?

Q.> can we create a primary key on duplicate column?
Ans: Yes
Below are the examples

select * from ZZ_EMP
/
select * from user_cons_columns
where table_name='EMP1'
/
select * from user_indexes
where table_name='ZZ_EMP'
/
select * from user_constraints
where table_name='ZZ_EMP'
/
create index id1_eno on zz_emp(empno)
/
alter table ZZ_EMP add constraint c_pk_zzeno primary key(empno) enable novalidate

No comments:

Post a Comment

hr schema

 CREATE TABLE regions     ( region_id      NUMBER         CONSTRAINT  region_id_nn NOT NULL      , region_name    VARCHAR2(25)      );      ...