Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6710153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:59:21+00:00 2026-05-26T07:59:21+00:00

I have three tables: users ———————————– id | firstname | lastname | username ———————————–

  • 0

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 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:59:22+00:00Added an answer on May 26, 2026 at 7:59 am
    SELECT q.*, u.*, COUNT(a.id) as answer_count
    FROM questions q 
    LEFT JOIN users u ON q.user_id = u.id
    LEFT JOIN answers a ON a.question_id = q.id
    GROUP BY q.id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three tables specifying important columns below Users(Id, username) Groups(Id, groupname, creator) (creator
I have three tables: User: UserId (pk) FirstName Lastname Messages: MessageId (pk) Heading Body
I have three tables to define users: USER: user_id (int), username (varchar) USER_METADATA_FIELD: user_metadata_field_id
I have three MySql tables: Users : UserId, UserName Tests : TestId, TestName Passes
I have three tables: Users, Groups and GroupsUsers User table: id: 1 username: admin
I have three tables in my sample database: Users ID Username Password Roles ID
I have three database tables: users , user_profiles and friends : users id username
This should be straightforward. I have three tables (relevant columns shown). users : ID,USERNAME,PWD
I have a database with three tables set up like this: Users : username,
I have three database tables: users emails invitations Emails are linked to users by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.