What is PostgreSQL
PostgreSQL is a powerful open-source relational database. Data is stored in tables with rows and columns, like a spreadsheet, but much more powerful and queryable. You've already used it in Magnifit and FinderDallas through Supabase.
-- Create a table
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
email TEXT UNIQUE NOT NULL,
age INTEGER,
created_at TIMESTAMP DEFAULT NOW()
);
-- Insert data
INSERT INTO users (name, email, age)
VALUES ('Daniel', 'daniel@example.com', 20);
-- Query data
SELECT * FROM users WHERE age > 18;
-- Update data
UPDATE users SET age = 21 WHERE id = 1;
-- Delete data
DELETE FROM users WHERE id = 1;