Skip to content

FreeCodeCamp project: Automating data insertion and querying data with SQL.

Notifications You must be signed in to change notification settings

CheilaDaSilva/world-cup-database-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💻 Project: WorldCup Database

Worldcup banner

Project goal:

Create a Bash script that enters information from World Cup games.csv file into PostgreSQL, then query the database for useful statistics.

Project made as part of the FreeCodeCamp Relational Databases Beta Certificate course

Creating the database

Dataset: games.csv

Created the database, 'worldcup', and the appropriate tables ('teams' and 'games') on PostgreSQL to visualise the data from games.csv.

Added appropriate constraints (primary keys and foreign keys) required to relate the tables.

Tables:

  • 'games' tracks all matches and scores made by both the winner team and the opponent team (using team_id as the identifier).
  • 'teams' lists all teams that played in the matches.

View: initial_tables_creation.sql

Relational Database diagram

worldcup diagram

Automating data insertion and querying with SQL

Created a Bash script that reads the games.csv data and uses SQL query commands to insert the data automatically into the tables previously created.

Took constraints into consideration when creating the Bash script to insert all winner and opponent teams individually into 'teams' and then into 'games' based on the team_id created.

View: insert_data.sh

Finished by writing a Bash script that utilises SQL to query the database and obtain useful values.

View: queries.sh

Database dump (after inserting data): worldcup.sql

About

FreeCodeCamp project: Automating data insertion and querying data with SQL.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages