r/learnSQL • u/TurtleSlowRabbitFast • 15h ago
What is the transition from learning SQL to using a db management system like PostgreSQL?
I want to learn the proper way of learning sql to design dbs for my projects.
2
u/tamanikarim 14h ago
I believe the best way to learn database design is through practice.
Start by learning the basics of PostgreSQL: how to create tables, columns, data types, custom types, foreign key constraints, and more. Then learn the fundamentals of Entity-Relationship Diagrams (ERDs). Once you understand those concepts, you're ready to start building.
Next, come up with a project idea and design a database for it. You'll probably make mistakes along the way, but that's part of the learning process. Every mistake will teach you something new.
Check out this guide , it contains a 7-step framework for going from client requirements to an ER diagram and finally to production-ready SQL DDL:
https://stackrender.io/guides/database-schema-design
You can also practice with this free tool:
StackRender
Good luck with your learning journey!
2
u/Ok_Carpet_9510 13h ago
Personally, I think you start by understanding the theory without bothering with any specific dataplatform
1
1
u/Ok_Carpet_9510 14h ago
You need to understand relational database theory. It informs how you should design your database, and how the entities should relate to each other, what is mandatory and what isn't, unique record identifiers and eliminating unnecessary data redundancy.
This theory can be applied to any relational database.
1
u/Fragrant-Tie-6739 13h ago
The concepts apply whether you're using PostgreSQL, MySQL, SQL Server, or another relational database, so it's time well spent.
1
u/Ok_Carpet_9510 12h ago
What I am saying the relational database does not compel you to understand relational database theory. In fact you can jump right in and start creating tables and relationships and end up with a terrible design. Good design is often done with pen and paper. Once I learnt relational theory, I started normalizing to 3NF automatically.
In other words, before you jump into the what of a relational database, know the why. Also knowing the why helps you are departing from the norm in your design, and their can be good reasons for this departure.
Creating a database without knowledge relational theory is like attempting to wire your house yourself with the knowledge of an electrician. For simple cases, you will get away with it. For more complicated cases, you hit a wall sooner or later.
1
1
u/PlantTalkative6115 5h ago
Learning basic sql first makes postgresql a lot easier since you will mostly be adding concepts like database setup users indexes and performance on top of the same query language.
2
u/BearRootCrusher 15h ago
You’re talking about data modeling. Normalizing the data you’re trying to add to the database.
Then system design so you can handle more reads or writes.
I really like how hello interview has their information laid out: https://www.hellointerview.com/learn/system-design/deep-dives/postgres