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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:12:53+00:00 2026-05-31T19:12:53+00:00

This is my table for a mysql database. http://the44.simorasic.com/cages.html I need to show the

  • 0

This is my table for a mysql database. http://the44.simorasic.com/cages.html

I need to show the number of cages for each cage size, along with the total expenditure (cost) in purchasing the cages of that size. Also, to show only the cage size, count of cages and total cost of cages.

What I have so far is this,

SELECT cageSize, COUNT(*) as "Number of cages"
from cage
GROUP BY cageSize;

So I have managed to count them, but the tricky part is adding the values together for each size, and then giving a total value for each size. Please help as this is part of my assignment, and I am completely stuck. I know I have to create a group for each size, and then sum the values, but can’t manage to do so.

  • 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-31T19:12:55+00:00Added an answer on May 31, 2026 at 7:12 pm

    What you are looking for can be found here:

    Group By aggregate functions

    Plus you will need the “WITH ROLLUP” keyword for getting the total.

    Group By modifiers

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

Sidebar

Related Questions

A mysql database table has a column whose datatype is time ( http://dev.mysql.com/doc/refman/5.0/en/time.html ).
Given a table named person (in a MySQL database/schema), kind of like this one:
This is most likely the culprit for this page: http://www.mypicx.com/04192010/ff/ table { border-collapse:collapse; }
I'm doing this tutorial: http://www.phpeveryday.com/articles/Zend-Framework-Database-Creating-Input-Form-P494.html We are building a simple input form using POST
I have to update a field in the MySQL database on each HTTP request
I have a table in a MSSQL database that looks like this: Timestamp (datetime)
In this MySQL table definition: CREATE TABLE groups ( ug_main_grp_id smallint NOT NULL default
I have this mysql table called comments which looks like this: commentID parentID type
Let's say I have a MySQL table that is something like this: software table:
I have a MySQL table like this: Payments +----+---------------------+---------+ | id | date (sorted

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.