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

  • SEARCH
  • Home
  • 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 6377189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:50:23+00:00 2026-05-25T01:50:23+00:00

I have a registration system. So basically, I have fields like age , gender

  • 0

I have a registration system. So basically, I have fields like age, gender, etc.

This is a simplified schema of my MySQL Database:

---------------------------------------
| id | name | age | gender | category |
---------------------------------------

Basically I want to generate overall reports like the total number of registrants in a category, total number of males, total number of females, etc.

I have a basic knowledge of SQL. I know that I can use COUNT and GROUP BY to see “summaries” for a single column. So basically, I’d have to do multiple queries to get “summaries” for all columns. Can I do this in one query instead?

I also am going to provide detailed summaries. By this I mean, I’d have to tally how many males are in a category, how many minors are in a category, etc. It’s sort of like a category X age, category X gender summary. Again, I know how to do this using multiple queries but I would like some opinion on a more elegant solution.

  • 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-25T01:50:24+00:00Added an answer on May 25, 2026 at 1:50 am

    I think you can accomplish wat you’re looking for using WITH ROLLUP:

    SELECT id, name, age, gender, category, count(*) cnt
    from my_table
    GROUP BY id. name, age, gender, category
    WITH ROLLUP;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I already have a simple registration system in place using php and mysql. It
I would like to have the authentication and registration parts of my website encrypted
I am wondering how to do the following... I have a registration system. When
I’m doing a patient registration system to a hospital, here we have 1st time
I have written a Silverlight application that is basically an account registration form. I
We have a simple registration form for our website users where we only require
I have a product registration form that allows the user to add additional product
I have a table of vehicles with registration numbers, and want to select a
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a
We have a big portal that needs user registration to allow them use its

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.