Build a Basic CRUD App with PostgreSQL, Express and React In this beginner project, we will create a simple users application using PostgreSQL, Express.js, Node.js and React.js. We will divide the application into small steps so that the complete flow is easy to understand. Action Method API Show users GET /api/users Add user POST /api/users Edit user PUT /api/users/:id Delete user DELETE /api/users/:id Step 1: Create the Database Open pgAdmin. Right-click Databases , select Create → Database , enter users_crud_db , and save it. Step 2: Open the Query Tool Select users_crud_db and open Tools → Query Tool . Step 3: Create the Users Table Run the following SQL query: users.sql SQL CREATE TABLE users ( id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, email VARCHAR(150) NOT NUL...
PostgreSQL is a powerful relational database management system. If you have worked with MySQL, learning PostgreSQL becomes easier because many common SQL commands work in a similar way. These notes cover PostgreSQL setup, basic SQL, joins, pagination, subqueries, CTEs and important advanced concepts with simple examples that you can practice in pgAdmin. 1. Install PostgreSQL and pgAdmin Install PostgreSQL Server and pgAdmin. During installation, create a password and remember it because pgAdmin will ask for it when connecting to the PostgreSQL server. After opening pgAdmin, go to: Servers → PostgreSQL 18 → Databases → postgres postgres is the default database. 2. Create a New Database Right-click Databases → Create → Database → Enter: practice_db → Save Select practice_db , then open: Tools → Query Tool Run your first query: SELECT 'Hello PostgreSQL'; Press F5 to execute it. 3. Create a Table CREATE TABLE employees ( id INT, na...