I have a stock table in the database:

Based on the data in the Stock Table, I want to have more detailed data as an output:

Stock Qty represents the total stock in stock for item A.
Location Qty represents the total number of elements for element A for each location.
Sub Location Qty represents the total number of Item elements for a specific location for each additional location.
I was wondering if there is a way to get detailed output in a single query, or should I make each query individually and write code to combine between each result.
I could write:
To get the Stock Qty value:
SELECT Item, Sum(Qty) as StockQty
From Stock
Group By Item;
To get Location Qty:
SELECT Item, Location, Sum(Qty) as LocationQty
From Stock
Group By Item, Location;
To get Sub Location Qty:
SELECT Item, Location, SubLocation, Sum(Qty) as SubLocationQty
From Stock
Group By Item, Location, SubLocation;
datagridview.
, , datatable datagridview.
.
AS400, , , ( ) .