I have three tables:
users
-----------------------------------
id | firstname | lastname | username
-----------------------------------
1 | John | Doe | jdoe
-----------------------------------
2 | Maria | T. | marty
-----------------------------------
3 | Alex | White | alexw
-----------------------------------
questions
--------------------------------------------
id | user_id | title
--------------------------------------------
1 | 2 | My first question?
--------------------------------------------
2 | 3 | One more question?
--------------------------------------------
3 | 3 | The third question?
--------------------------------------------
answers
----------------------------------------------
id | question_id | description
----------------------------------------------
1 | 2 | Answers to the 2nd question
----------------------------------------------
2 | 1 | Answer for 1st question
----------------------------------------------
3 | 1 | Another answer for 1st
----------------------------------------------
Now,I want to retrieve all question with user’s(asker’s) firstname, lastname, username and count of total answers given for a question.
Please help writing it. Since I have messed my query, not posted here.
Thanks
1 Answer