𝗣𝗼𝘀𝘁𝗴𝗿𝗲𝗦𝗤𝗟 𝗕𝗮𝘀𝗶𝗰𝘀 𝗙𝗼𝗿 𝗕𝗲𝗴𝗶𝗻𝗻𝗲𝗿𝘀

Stop using JavaScript arrays for long term storage. Use PostgreSQL to store data permanently.

PostgreSQL uses tables. A table is like a spreadsheet. It has columns for structure. It has rows for data.

PostgreSQL forces you to pick data types.

Store phone numbers as TEXT. Numeric types remove the leading zero.

You use four main commands:

Always use a WHERE clause with UPDATE and DELETE. Without it, you change every row in the table.

Learn about relationships. One client has many projects. You use a foreign key to link them. A foreign key is a column in one table pointing to another. It ensures a project belongs to a real client.

Store data where it logically belongs. Projects have budgets and stages. Clients do not. Put project details in the projects table.

Errors teach you how databases think. A good design mirrors reality. Relationships matter more than tables.

Source: https://dev.to/chinwuba_jeffrey/understanding-postgresql-tables-relationships-and-foreign-keys-a-beginners-journey-p6j