Loosely follows the Udemy course The Complete SQL Bootcamp: Go from Zero to Hero led by instructor Jose Portilla.
- Clone the repository via
git clone https://github.com/pythoninthegrass/sql_zero_to_hero.git - Change into the directory via
cd sql_zero_to_hero - Copy
.env.exampleto.envand update the values - Run
docker-compose up -dto start the PostgreSQL and Python containers - Exec into either
# python docker exec -it python-udemy bash # postgres docker exec -it postgres-udemy bash
- To exit the container, type
exit, and hitReturn - Connect to the PostgreSQL container via either pgadmin or TablePlus
- Once finished, run
docker-compose stopto stop the containers - To remove the containers, run
docker-compose down --volumes
- Test the main.py script. e.g.:
λ docker exec -it python-udemy bash root@python-udemy:/app# ./main.py Traceback (most recent call last): File "/app/./main.py", line 24, in <module> cur.execute("SELECT * FROM payment") psycopg2.errors.UndefinedTable: relation "payment" does not exist LINE 1: SELECT * FROM payment ^
- Complete course
- Organize sections with relevant SQL files and notes

