通用数据库表 [英] Generic DB Table
问题描述
以下数据库表设计有任何名称:
基本上,我们有表示键/值对的通用列。
id | k1 | v1 | k2 | v2 | k3 | v3 | ....
1 |名称| sam | last_name |史密斯| NULL | NULL | ...
在我的应用程序中,我有很多表只有一行,我想将它们合并成一个通用表,表示单个表行的行。
提前感谢。
Entity-Attribute-Value。也称为名称 - 值表或开放模式。 href =http://www.slideshare.net/billkarwin/sql-antipatterns-strike-back =noreferrer> SQL反模式
在我回答问题产品表,多种产品,每个产品都有很多参数。
Is there any name for the following DB table design:
Basically we have generic columns representing key/value pair.
id | k1 | v1 | k2 | v2 | k3 | v3 | ....
1 | name | sam | last_name| smith | NULL | NULL | ...
In my application, I have many tables that have only one row and I would like to merge them into a generic table that has X number of columns with each rows representing singular table rows.
Thanks in advance.
Entity-Attribute-Value. Also called a "Name-Value Table" or an "Open Schema."
This is an SQL Antipattern. It fails many rules of relational database design, and it's incredibly hard to maintain. I recommend against it.
See more of my thoughts about EAV in my answer to the question "Product table, many kinds of product, each product has many parameters."
这篇关于通用数据库表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!