payalsaxena1504
05-03-2006, 04:23 PM
i'm new to SQL used in oracle 8i .i've a confusion regarding primary key & foreign key.is it necessary for a foreign key in a table should be of same name as the primary key of master table which it is referencing.i mean can i keep a foreign key field of a table a different name from the primary key field of master table.if it is possible then what will be the syntax of creation of table having foreign key field.as the suyntax is
create table table_name
field1 type(size),
field 2 type (size) referencing master table_name ;
here field 2 is foreign key referencing to master table having the primary key of same name as field 2 in the table going to be created.
if we give different names to primary key & foreign key then what will be the syntax?
thanks for help!
create table table_name
field1 type(size),
field 2 type (size) referencing master table_name ;
here field 2 is foreign key referencing to master table having the primary key of same name as field 2 in the table going to be created.
if we give different names to primary key & foreign key then what will be the syntax?
thanks for help!