- Use advanced SQL technique to answer some questions regarding the NBA
- Some answers match successfully with independent reports
- SQL technique applied
- common table expression (CTE)
- row_number() over()
- rank() over()
- left join, inner join
- union all
- min(), max(), round(), sum(), avg(), abs(), count()
- alias for columns and tables
- case ... when ...
- group_concat()
- Python libraries used
- pandas
- sqlite3
- os
- PhD in Cognitive Psychology, Iowa State University in Ames, Iowa, USA
Social media:
Data source
- Overview
- About the author: Kam Leung Yeung
- Table of content
- Read in data
- Read pandas dataframe into sql database
- Questions to be answered
- Most consecutive 40+ pts game by a player
- The top 3 individual player score in every season between 2012 and 2022
- The top 5 score individual player score since 2004
- The biggest blown out in every season and the corresponding margin
- Identify versatile players who started with most different positions