Re: Select row cells as new columns - Mailing list pgsql-sql

From lewbloch@gmail.com
Subject Re: Select row cells as new columns
Date
Msg-id cadaa466-54ba-4678-ac75-afa8e9165c66@googlegroups.com
Whole thread Raw
In response to Re: Select row cells as new columns  (danycxxx <danycxxx@yahoo.com>)
List pgsql-sql
danycxxx wrote:
> Yes, I've looked at it, but id doesn't create the desired output. After more
> research I've found that I my design is similar to Entity, Attribute and
> Value(EAV) design and I think I have to redesign. Any suggestion regarding
> EAV? Is there any other approach?

EAV is controversial. I am uncomfortable with it because it implements 
keys as values.

I suggest that you not use EAV. Its putative flexibility comes at a large 
implementation price.

The other approach is relational database design. You model an entity as 
a collection of tables, each of which represents an aspect of the data 
pertinent to the entity. Each table has columns, the labels of which 
correspond generally to the names of attributes for that aspect. Each 
row of each table provides values for its respective named columns.

So a table roughly models what I'll call an "entitylet" - a cohesive piece 
of the entity model.

The rules to decompose entity models into relational data models 
constitute "normalization". I suggest you create a relational data model 
normalized to at least third normal form.

-- 
Lew


pgsql-sql by date:

Previous
From: msi77
Date:
Subject: Re: Lowest 2 items per
Next
From: lewbloch@gmail.com
Date:
Subject: Re: Job control in sql