In this project, I utilized Python and SQL to analyze the European Soccer database. SQL, a specialized programming language for working with databases, was employed to interact with the data. Python, on the other hand, offers a variety of powerful libraries such as Pandas, NumPy, Matplotlib, and Seaborn for efficient data manipulation and visualization.
Pandas proved instrumental in handling and transforming the data, while Matplotlib and Seaborn enabled me to create visually appealing and insightful representations of the query results.
The European Soccer database, obtainable from Kaggle, served as the primary data source. It encompasses comprehensive information about soccer players in Europe, including teams, selected leagues, played matches, and corresponding outcomes spanning the 2008/2009 season to the 2015/2016 season. The integration between the database and the SQLite server was facilitated using the SQLite3 library within the Jupyter Notebook environment.
The primary objective of this project was to demonstrate the synergistic potential of Python and SQL in efficiently manipulating and extracting valuable insights from a database.
Because I executed the SQL queries within a Python Jupyter notebook, I had to encapsulate the SQL statements with a Python wrapper to seamlessly integrate them into my workflow.
Let's examine the distribution of teams across different countries in the database. It's important to note that the database covers multiple seasons. For instance, while England consistently has 20 teams per season, the presence of relegation and promotion results in a total of 34 unique teams over time. This accounts for the fact that three teams are relegated each season, with three other teams taking their place.
The Spanish La Liga and the English Premier League exhibit a higher number of total goals scored. However, when considering the average number of goals per match, the Netherlands Eredivisie emerges as the leading league. To visually represent this result, we can create a visualization.
My favorite club in England is Chelsea and in the 2011/2012 season, the club won the Champions League but could only finish 6th in the Premier League. We can take a look at the most goals Chelsea scored at home in the premier league.
We can see that the most goals scored at home by Chelsea in the 2008/2009 season was 6.
It would be better to visualize the above result.