r/SQL • • 4d ago

Discussion [ Removed by moderator ]

/r/SQL/comments/1y4ow3l/removed_by_moderator/

[removed] — view removed post

0 Upvotes

5 comments sorted by

•

u/SQL-ModTeam 2d ago

This forum is intended for solutioning and discussion of specific topics. Please check out the sub sidebar and wiki content for beginner resources. Also be sure to checkout r/learnSQL

1

u/datadriven_io 4d ago

Some experience with databases but that’s it. For sql interview prep, try datadriven before walking into the next round. It’s going to end up taking me 2 months to solve once I finish the capstone (just started it).

1

u/mirinai_ai 4d ago

One thing that makes this harder than it needs to be: relational and non-relational design start from opposite ends. Relational design starts from the data. You work out what things exist, how they relate, and normalize so each fact is stored once, and the queries come later. Document and key-value design starts from the queries. You list every way the app will read the data first, then shape the records so each read hits one place, duplicating data on purpose. Studying both at the same time gets confusing if you don't keep that difference in mind.

Some resources that are each strong on one side:

- Database Design for Mere Mortals (Michael Hernandez): slow and thorough on the relational basics, entities, keys, relationships and normalization, without assuming much background.

- SQL Antipatterns (Bill Karwin): common relational design mistakes and why they hurt later. Best once the basics click, since seeing what breaks teaches a lot.

- The DynamoDB Book (Alex DeBrie): even if you never use DynamoDB, its access-pattern-first way of thinking carries over to most NoSQL design.

- Designing Data-Intensive Applications (Martin Kleppmann), chapter 2: compares the relational, document and graph models and when each one fits.

An exercise that ties them together: take one small app and design it both ways. Write the tables first, then list the five most common screens and design documents that serve each screen in one read. Seeing where the document version has to duplicate data and where the relational version needs joins shows the trade-off faster than reading about it.

1

u/CaptainOttar 4d ago

I'd pick up Database Design for Mere Mortals by Michael Hernandez for the fundamentals. It stays away from vendor-specific syntax and makes you work out your entities and relationships before you create a single table. Once relational modeling clicks, choosing a NoSQL layout gets easier too, because you can see what you're trading away.

1

u/Discordbothost 2d ago

Try modeling a room booking. Write down one rule first: two bookings for the same room can't overlap. Then test two requests arriving together. Where does your design enforce that rule?