Hi,,,
I have a question that if we want to create the relationship between two tables than what should we have to do...
i mean we have to set primary key for both tables ??
an other question is that can we create relationship between two database??
How to create relationship between two tables, is primary key necessary for both tables?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Pravin MoreRank #1,419 · 1.2K reputationPosted Sep 20, 2011, 11:04 PM EDT
I think, its depend on your design and relationship, if your design dont want PK then rethink your design because what is point in putting identicle records in table...it will create problem even for joins......enev you cant give any indexes on table.
i thibk there are very few cases where PK is not needed like temp tables for loading bulk data...
Thanx,
Pravin.
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Sep 20, 2011, 11:05 PM EDT
Any one table should have unique key.
To link the DB read this
Hemant KumarRank #1,202 · 1.5K reputationPosted Sep 20, 2011, 11:16 PM EDT
you can create the foriegn key relationship as below
create table GAME ( NAME varchar(50) ,developer varchar(50) ) create table SCORES ( NAME varchar(50) FOREIGN KEY REFERENCES game(name) ,generalScore int ) Here the GAME table Name column is related to SCORES table as a foriegn key. Please see this Video Link http://www.youtube.com/watch?v=xL7h4VQhXFY