This repository contains all of my case study solutions through SQL queries for #8WeekSQLChallenge by Danny Ma.
There are eight interesting fictional case studies in this challenge.
No | Image | Case Study Name | Medium | GitHub | Status |
---|---|---|---|---|---|
1 | Danny's Diner | Link | Link | 🟢 Completed (04/05/2023) |
|
2 | Pizza Runner | - | - | ⚪️ To Do |
|
3 | Foodie-Fi | - | - | 🟢 Completed |
|
4 | Data Bank | - | - | ⚪️ To Do |
|
5 | Data Mart | - | - | ⚪️ To Do |
|
6 | Clique Bait | - | - | ⚪️ To Do |
|
7 | Balanced Tree Clothing Co. | - | - | ⚪️ To Do |
|
8 | Fresh Segments | - | - | ⚪️ To Do |
My project utilizes PostgreSQL and pgAdmin to manage Danny's database via Docker Compose. This allows for a consistent and portable database environment across different machines. All eight Danny's databases will be stored as .SQL files in the initdb
folder. After deploying this setup, you can access pgAdmin to manage and view Danny's database at http://localhost:8080.
- Git installed (https://git-scm.com/)
- Docker installed (https://www.docker.com/)
- Clone this repository to your local machine.
- Navigate to the project directory.
- Create and configure the following values in the
.env
file.- POSTGRES_USER=<your_postgres_username>
- POSTGRES_PASSWORD=<your_postgres_password>
- PGADMIN_EMAIL=<your_pgadmin_email>
- PGADMIN_PASSWORD=<your_pgadmin_password>
- Run
docker compose up -d
in your terminal to start the PostgreSQL container and pgAdmin in detached mode.
By default, pgAdmin is accessible through a web interface at http://localhost:8080/. Credentials for accessing the database will be defined in the .env
file. After logging in, you can add your database to pgAdmin.
- Right-click "Servers" in the top-left corner and select "Create" -> "Server..."
- Name your connection
- Change to the "Connection" tab and add the connection details:
- Hostname: "postgres"
- Port: "5432"
- Maintenance Database: danny_db
- Username: $POSTGRES_USER (see .env)
- Password: $POSTGRES_PW (see .env)
To stop the containers, run docker compose down
in your terminal.
If you want to remove all data in the containers, run docker compose down -v
.
https://event-driven.io/en/automatically_connect_pgadmin_to_database/