Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Was curious myself so asked chatgpt and this what I got:

Nested aggregates in databases are useful when you want to perform calculations or summaries on groups of data within larger groups. For example, imagine you have a database of sales transactions with products and categories. You could use nested aggregates to find the total sales for each category and then calculate the average sales per category. It saves effort by allowing you to perform calculations at different levels of granularity in a single query.



goal directed programming is the related non-sql programming paradigm. unicorn/icon[1]

----

Use cases:[2]

autoparts inventory (book keeping page statics of sales/sales person, parts, inventory on hand, etc)

internet statistics for through put on all interfaces on group of servers [0]

--- topic related books:

Joe Celko has book series 'SQL for Smarties' that covers basic through advanced aggrecation with sql using example queries.

Joe Celko's 'Trees and Hierarchies in SQL for Smarties' covers some of the ideas related to 'SQL statment returned a database'?

---

[0]: https://dba.stackexchange.com/questions/173044/nested-aggreg...

[1] : http://unicon.org/

[2] : https://cs.uwaterloo.ca/~tozsu/courses/CS338/lectures/6%20Ne...




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: