Data Modeling - Generic Data Model

1 - About

You can represent any object in a database using just four tables. It's well known as the generic data model.

Good for the flexibility but not good for the database performance and for the simplicity of the SQL statement.

3 - Data Model

CREATE TABLE objects ( oid int primary key, name VARCHAR2(255) );
CREATE TABLE attributes 
( attrId int primary key, attrName VARCHAR2(255), 
datatype VARCHAR2(25) );
CREATE TABLE object_Attributes 
( oid int, attrId int, VALUE VARCHAR2(4000), 
primary key(oid,attrId) );
CREATE TABLE Links ( oid1 int, oid2 int, 
primary key (oid1, oid2) );

4 - Documentation / Reference

data/modeling/data_model_generic.txt ยท Last modified: 2017/09/13 21:21 by gerardnico