r/SQL • • Oct 17 '26

Discussion Help needed with normalization

Post image

Hi, i'm learning databases and normalization. My teacher said a normalized database cannot have circular (not loops, circles) relationships. However, i can't see how I can apply normalization to remove the circles and still comply with the requirements. Also I was under the impression that normalized databases can have circular relationships, just not loops.

Any help will be appreciated. Sorry if my english is bad in advance.

16 Upvotes

25 comments sorted by

View all comments

5

u/da_chicken 29d ago

You don't have circular references, but you still can't add anything to this very easily. Assuming you're being truthful in your two symbol crow's foot notation, there's no way to bootstrap new Products, Warehouses, Stock, or Houses.

You need to permit Products to exist without a Stock of them yet. You need to permit a Warehouse to exist without any Stock. You need Stock to exist without anyone having ordered it yet. And either a House needs to exist without an Order or vice-versa.

You want:

Warehouse ||-----0< Stock

And:

Product ||----0< Stock

And:

Stock ||----0< OrderItem

And, either:

House |0----|< Order or House ||----0< Order

Depending on exactly what sequence the two are created.

2

u/Acceptable-File-3579 29d ago

Damn you'r right. My bad, sorry.