i have two tables in my sql database one is "vendor" and other "purchase_order" they both have one common attribute "vendor_name" my problem is that i want vendor name in my "purchase_order" table to be same as that in "vendor" table but vendor_name is not a primary key in "vendor" table so i cannot use primary key_foreign_key reference. what should i use??
arbazpathan 0 Newbie Poster
Recommended Answers
Jump to PostHello arbazpathan,
primary-key property is not required for table "vendor" if its "vendor_name" is already declared to be unique. If so, you can easily put a foreign-key constraint on table "purchase_order" referencing vendor(vendor_name) by means of "create table purchase_order(...)" or by "Alter table purchase_order ..." if table "purchase_order" already …
All 4 Replies
adam_k 239 Master Poster
tesuji 135 Master Poster
arbazpathan 0 Newbie Poster
adam_k 239 Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.