Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

if table has reference ,then could i put refered table with refering table seperately

 
walter wang
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All
Questions is from here
One Table called product is refering to another
table called Category by foregin key catId.
I think this kind of reference is just a logical
binding. so althoug there is relation ship between
them, but i could put them seperately, even on different machine.
but sql file for creating Product table has
one sentence (references category (catid))
if i dont build category table, will i not be able
to create product table?
or if i remove this sql sentence(references category (catid)) to create Product table
will it cause problem for this reference between
product table and category table ?
create table product (
productid char(10) not null,
category char(10) not null,
name varchar(80) null,
image varchar(255) null,
descn varchar(255) null,
constraint pk_product primary key (productid),
constraint fk_product_1 foreign key (category)
references category (catid)
)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic