__STYLES__
People of all ages are fascinated by Lego including me so I decided to dive into the dataset provided by Rebrickable on their website and performed an exploratory analysis to uncover some trends overtime.
I created a Lego database in SQL and imported all the tables in it.
I, then started exploring the data by answering these question.
With the help of these questions we were able to gain a deeper insight of the Lego history.
Firstly, we found out that Technic, Star Wars & Friends are top 3 themes with the highest number of parts while Star Wars & Bionicle were the most popular themes in the 21st century as they had highest number of sets in multiple years.
Secondly, 2022, 2021, 2020, 2019, 2017 are the Top 5 years with most number of parts produced. We also found out that there has been a fairly consistent increase in the average no. of sets released per year since 2016.
Also, we looked at how the Lego Toy company grew over the century from producing 4995 sets to 15,608 sets in the 21st Century.
Additionally we looked at the most commonly used colors for Lego toys too. To my surprise Black & White both were in the top 3 popular colors.
Lastly I also looked at what % of sets were Harry Potter themed (another family favourite). It accounted for only 1.2% of the total lego sets released in the 21st century.
SQL concepts/functions used: Joins, CTES, Nested Queries, Aggregations( Count,Sum, Avg), Row number, Case Statement.