Skip to main content
FREE Mock interview & resume review with Sumit. Free right now, no payment needed.Book a slot

PostgreSQL and SQL Fundamentals

Learn relational database concepts with PostgreSQL.

jiocoder TeamUpdated Jun 6, 20261 min readPostgreSQL
PostgreSQL and SQL Fundamentals

SQL Basics#

Code
-- Create table
CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  name VARCHAR(100),
  email VARCHAR(100) UNIQUE,
  age INTEGER
);

-- Insert
INSERT INTO users (name, email, age)
VALUES ('John', 'john@example.com', 30);

-- Select
SELECT * FROM users WHERE age > 25;

-- Update
UPDATE users SET age = 31 WHERE name = 'John';

-- Delete
DELETE FROM users WHERE id = 1;

Joins#

Code
SELECT u.name, p.title
FROM users u
INNER JOIN posts p ON u.id = p.user_id;

Article discussion

(0)

Join the discussion — login to comment and help other developers.

Login to comment