Thislesson takes you through the step-by-step process of installing PostgreSQL on Windows 11, setting up pgAdmin, and creating your first database and table using both the command line (psql) and the GUI (pgAdmin). Stick around for SQL scripts to help you practice!
🔗 What You’ll Learn in This Video:
Install PostgreSQL on Windows 11.
Set up pgAdmin and explore its interface.
Create a database and table using psql and pgAdmin.
Perform basic CRUD operations (Insert, Update, Delete, Select).
🛠️ SQL Commands Used in This Tutorial
-- Create a new database
CREATE DATABASE DemoDB;
-- Switch to the new database
\c DemoDB
-- Create a table
CREATE TABLE Employees (
EmployeeID SERIAL PRIMARY KEY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
Department VARCHAR(50),
Salary NUMERIC(10, 2)
);
-- Insert sample data into the table
INSERT INTO Employees (FirstName, LastName, Department, Salary)
VALUES
('John', 'Doe', 'IT', 75000.00),
('Jane', 'Smith', 'HR', 60000.00),
('Mike', 'Brown', 'Finance', 80000.00);
-- Retrieve all data from the table
SELECT * FROM Employees;