The aim of this project is to explore the possibility of the interaction between postgresql and python
The data used in this project eas obtained from Kaggle. And it is made of three CSV files. the file containing data related to world cup attendance from 1930 up to 2022. Here we are going to describe each file with pictures showing its respective columns individually\
-
Attendance: having general information related to each world cup(Host country, total attendance, etc..
-
Awards: containing information for every and each spefic awards winners at each world cup
-
Finals: contains each and every finall information(winner, score, etc
The main python library used in this case is psycopg2, which is the most popular PostgreSQL database adapter for the Python programming language. We will also be using pandas, will be usefull as some of its functions and methods will be needed for this project.
The first task consists of geting or downloading the three csv files forming our dataset from Kaggle, and for this project we included them in our working directory
Here we used the famous python library called psycopg2, which allows us to interect with our postgresql in python. So for this a database called worldcup was created with three tables called attendance, awards and finals. And all was achieved after ensuring a coonection to our database was available
Here we inserted all values present in our csv files into the three tables created in postgresql.(At this stage we faced a problem related to the last table or the table called "final", but fortunatelly we just noticed that it wa a simple syntax error:))))))
All the detailed code and explanation can be found here