| Goal | Find base tables that implement a highly generic database design (EAV design - Entiry-Attribute-Value design), according to which attribute values are recorded in a generic table that contains attribute-value pairs. |
|---|---|
| Notes | In case of the string_agg function, the line break (br) tag is used as a part of the separator for the better readability in case the query result is displayed in a web browser. Because the query relies on the names of base tables the query result can have false positive and false negative results. The query considers both table names in English and Estonian. |
| Type | Problem detection (Each row in the result could represent a flaw in the design) |
| Reliability | Low (Many false-positive results) |
| License | MIT (opens in new tab) |
| Data Source | INFORMATION_SCHEMA only |
| SQL Query |
|
Categories
This query is classified under the following categories:
Database design antipatterns
Queries of this category provide information about possible occurrences of SQL database design antipatterns.
Result quality depends on names
Queries of this category use names (for instance, column names) to try to guess the meaning of a database object. Thus, the goodness of names determines the number of false positive and false negative results.
Structure of base tables
Queries of this category provide information about the structuring of base tables at the database conceptual level
| Name | Description |
|---|---|
| Database design antipatterns | Queries of this category provide information about possible occurrences of SQL database design antipatterns. |
| Result quality depends on names | Queries of this category use names (for instance, column names) to try to guess the meaning of a database object. Thus, the goodness of names determines the number of false positive and false negative results. |
| Structure of base tables | Queries of this category provide information about the structuring of base tables at the database conceptual level |
Further reading and related materials:
This is one of the antipatterns from the Bill Karwin's book of SQL antipatterns. See Chapter 6: Entity-Attribute-Value.
Smell "Metadata as data": Sharma, T., Fragkoulis, M., Rizou, S., Bruntink, M. and Spinellis, D.: Smelly relations: measuring and understanding database schema quality. In: Proceedings of the 40th International Conference on Software Engineering: Software Engineering in Practice, pp. 55-64. ACM, (2018).
Eessaar, E. and Soobik, M.: On universal database design. Baltic DB & IS, pp. 349-360, (2008).
| Reference |
|---|
| This is one of the antipatterns from the Bill Karwin's book of SQL antipatterns. See Chapter 6: Entity-Attribute-Value. |
| Smell "Metadata as data": Sharma, T., Fragkoulis, M., Rizou, S., Bruntink, M. and Spinellis, D.: Smelly relations: measuring and understanding database schema quality. In: Proceedings of the 40th International Conference on Software Engineering: Software Engineering in Practice, pp. 55-64. ACM, (2018). |
| Eessaar, E. and Soobik, M.: On universal database design. Baltic DB & IS, pp. 349-360, (2008). |
| Mistake (3): https://www.red-gate.com/simple-talk/sql/database-administration/five-simple--database-design-errors-you-should-avoid/ |