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 271613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:11:32+00:00 2026-05-12T00:11:32+00:00

My boss is asking me to code a report that has the following components:

  • 0

My boss is asking me to code a report that has the following components:

  • A pie chart of employee count by state
  • A pie chart of employee count by age bracket (10 year brackets)
  • A pie chart of employee length of service (5 year brackets)
  • A pie chart of employee Male/Female breakdown
  • A pie chart of employee count by salary band (computer generates brackets).

There may be others.

I know I can do this by writting 5 different sql statements. However it seems like this would generate 5 table scans for one report.

I could switch gears and do one table scan and analyse each record on the front end and increment counters and probably accomplish this with one-pass.

Which way would the collective wisdom at stackoverflow go on this?

Is there a way to accomplish this with the CUBE or ROLL UP clauses in T-SQL?

  • 1 1 Answer
  • 1 View
  • 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-12T00:11:33+00:00Added an answer on May 12, 2026 at 12:11 am

    If your data is properly indexed, those reports may not require any table scans at all.

    Really, for a problem like this you should code up the reports the simple way, and then see whether the performance meets the business requirements. If not, then look at optimisation strategies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say at your job your boss says, That system over there, which has
My boss has a habit of performing queries on our databases that return tens
My boss has asked for a page that will not change to have two
My boss has come to me and asked how to enure a file uploaded
I've got an angry boss that will beat me down if I waste another
I hope this question is not 'controversial' - I'm just basically asking - has
My boss keeps asking me which version of .NET are we upgrading to, to
My boss just told me that he learned about fast VB6 algorithms from a
Background: My boss has tried exporting an ASC key to me with public and
I think they are same thing but my boss say that is not right.

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.