I have a table QuestionTarget
Its fields are
(questionID,QuestionTarget)
And Another table Answer
(AnswerID,Q01ID,Question01Answer,Question02ID,Question02Answer.......)
In answer table I have all answers in one row with their own column like question01,answer01,question02,answer02......
Now I want to get the target value from First table(questiontarget) and Answer of that target from second table Answer table how to join these two table
Loading

Sibeesh VenuPosted Dec 25, 2014, 12:38 PM
The main reason for primary and foreign keys is to enforce data consistency.
A primary key enforces the consistency of uniqueness of values over one or more columns. If an ID column has a primary key then it is impossible to have two rows with the same ID value. Without that primary key, many rows could have the same ID value and you wouldn't be able to distinguish between them based on the ID value alone.
A foreign key enforces the consistency of data that points elsewhere. It ensures that the data which is pointed to actually exists. In a typical parent-child relationship, a foreign key ensures that every child always points at a parent and that the parent actually exists. Without the foreign key you could have "orphaned" children that point at a parent that doesn't exist.
Read more here :
http://stackoverflow.com/questions/5771190/can-we-join-two-tables-without-primary-foreign-key-relation