Danish Habib

Danish Habib

  • NA
  • 694
  • 243.4k

Accessing Records from Two tables

Dec 24 2014 6:54 AM
Dear All I have a Question about fetching the tables record Below is the details of my tables 
1-Table)QuestionTarget:(QuestionID,QuestionTargetValue)
2-Table)AnswerTable:(AnswerID,Question01,Answer01,Question02,AnswerTwo,Question03,Answer03)


I already knows that the above database structure is quite bad as the answer table should have one row for each answer instead of a single row for all Question01,answer01,question02,answer02 --------


Question Target Table:


QuestionID,                      Question Target 
1                                            22


Answer table 

Answer ID Question01(this is id)  QuestionTotal  Question02(this is id of question2) Q2total
1                         1                        33                2                                44

now above table shows that i have one row for all question like question 1,2,3----- so should i make all these as foreign key so that i will be able to fetch the records from both table, or what else.

How to fetch the target from QuestionTarget table and Answer from Answer table without joining

Thanks in advance 





Answers (2)