I am a bit confused :
CREATE TABLE suppliers
( supplier_id numeric(10) not null,
supplier_name varchar2(50) not null,
contact_name varchar2(50),
CONSTRAINT suppliers_pk Unique (supplier_id,supplier_name)
);
insert into suppliers values(1,'farhan','sohail');
insert into suppliers values(1,'farhanAnsar','sohail');
CREATE TABLE supplier
( supplier_id numeric(10) not null,
supplier_name varchar2(50) not null,
contact_name varchar2(50),
CONSTRAINT supplier_pk PRIMARY KEY (supplier_id,supplier_name)
);
insert into supplier values(1,'sname','cname');
insert into supplier values(1,'suppName','cname');
Both works fine. Then What exactly is the difference b/w them?
Can someone elaborate?
Few more things :
A table can have only one primary key. Combination of 2 or more columns can be used as a primary key, but primary keyword cannot be used on 2 separate columns? Am i correct?