Skip to content

Latest commit

 

History

History
64 lines (40 loc) · 1.21 KB

README.MD

File metadata and controls

64 lines (40 loc) · 1.21 KB

PostgreSQL Database

This project is a dockerized PostgreSQL database with an employee_data table and some sample data into it.

Project Structure

db
├── Dockerfile # Docker definition of the PostgreSQL DB
├── init.sql   # SQL scritps to create and populate a table with sample data
└── README.md  # Project documentation

Setup Instructions

  1. Clone the repository:
git clone <repository-url>
cd db/
  1. Build the Docker image:
docker build -t demo-tat .
  1. Run the container:
docker run -d --name demo-tat-postgres-container -p 5432:5432 demo-tat

Usage

Once the container is running, you should be able to connect into it and run SQL queries.

psql -h localhost -U dbuser -d demo

SELECT * FROM employee_data;

The result should be similar to the one demonstrated below.

 id |     name      | age |    designation     | salary
----+---------------+-----+--------------------+--------
  1 | Alice Johnson |  38 | CEO                |  50000
  2 | Bob Smith     |  40 | CTO                |  40000
  3 | Charlie Brown |  35 | VP of Engineering  |  35000
(3 rows)

License

This project is licensed under the MIT License.