๐ง๐ต๐ฒ ๐๐ฎ๐๐ฎ๐ฏ๐ฎ๐๐ฒ ๐๐ฟ๐ฒ๐ฎ๐ธ๐ฑ๐ผ๐๐ป I've been a frontend developer for a while. I've used React, Supabase, and Cloudinary. But I never understood what happened inside the database. I used the Supabase dashboard, hoping for the best.
Databases look like spreadsheets. But Postgres enforces rules on your data.
- NOT NULL means the field is required
- UNIQUE means no two rows can share that value
- DEFAULT means Postgres fills it in automatically if you don't provide it
These rules catch bad data before it touches your application. You connect two tables like this:
- client_id REFERENCES clients(id) tells Postgres to only allow values that exist in the clients table
You can query related data together using JOIN.
- JOIN pulls data across tables
- You can use AS aliases to give each column a unique label
Understanding raw SQL makes a difference. It helps you debug confidently. Next, I'll learn about Prisma ORM. Source: https://dev.to/chinwuba_jeffrey/databases-heres-what-actually-clicked-156e