According to my findings, multiple unique columns in a table work in a collective fashion. For example:
SQL> create table demo (
name varchar2(20),
col1 varchar2(15),
col2 varchar2(15),
constraint demo_uc
unique (col1, col2) );
SQL> insert into demo values ('fritz', 'red', 'green');
1 row created.
SQL> insert into demo values ('joe', 'red', 'blue');
1 row created.
SQL> insert into demo values ('joe', 'red', 'green');
insert into demo values ('joe', 'red', 'green')
*
ERROR at line 1:
ORA-00001: unique constraint (OPS$ALIVE.DEMO_UC) violated
Is it possible to create a table where each field has to be unique? So for example that neither col1 nor col2 can have duplicate fields?
Thanks!