Home  >  Article  >  Backend Development  >  Which paradigm does this database design violate?

Which paradigm does this database design violate?

WBOY
WBOYOriginal
2016-10-24 00:12:411053browse

For example, for a shopping cart data table, someone designed it like this, cert(id, uid, item1, item2, item3...), but the correct way should be to divide it into two tables, cert(cert_id, item), cert( uid,cert_id).

So what paradigm does the incorrect table violate? Why?

Reply content:

For example, for a shopping cart data table, someone designed it like this, cert(id, uid, item1, item2, item3...), but the correct approach should be to divide it into two tables, cert(cert_id, item), cert( uid,cert_id).

So what paradigm does the incorrect table violate? Why?

The database design is wrong, certid and uid may determine multiple items, and the table items are different. Unless the first table item is a multi-valued attribute, then this violates the 4th normal form. At the same time, since the certid determines the item, the first table partially relies on the second normal form and is not satisfied

I think it’s normal, norms are dead, only flexibility is reasonable

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn