# Aggregating NBA data, PostgreSQL vs MongoDB

DevFeed: [Aggregating NBA data, PostgreSQL vs MongoDB](<https://devfeed.tech/articles/aggregating-nba-data-postgresql-vs-mongodb-34534.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2014/02/aggregating-nba-data-postgresql-vs-mongodb/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2014-02-17T22:40:00Z

Content type: comparison

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [MongoDB](<https://devfeed.tech/topics/mongodb.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [data](<https://devfeed.tech/topics/data.md>)

Tags: [aggregate](<https://devfeed.tech/tags/aggregate.md>), [aggregation](<https://devfeed.tech/tags/aggregation.md>), [databases](<https://devfeed.tech/tags/databases.md>), [mongodb](<https://devfeed.tech/tags/mongodb.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

This comparison loads NBA statistics from a BSON file into PostgreSQL, designs a normalized relational schema, and expresses a MongoDB aggregation query in SQL. It explains how PostgreSQL views, joins, filtering, grouping, ordering, and limiting can reproduce the referenced aggregation workflow.

## Source excerpt

When reading the article Crunching 30 Years of NBA Data with MongoDB Aggregation I coulnd't help but think that we've been enjoying aggregates in SQL for 3 or 4 decades already. When using PostgreSQL it's even easy to actually add your own aggregates given the SQL command create aggregate.