Re: [SQL] weird structure

2000-08-27 Thread Yury Don
Renato De Giovanni wrote: > > > > Consider the following tables/fields: > > > table "person": fields "p_id", "p_name". > > > table "person_attribute": fields "a_id", "a_name". > > > table "person_data": fields "d_person_id", "d_attribute_id", > > > "d_value". > > > > > > Also consider that a pers

Re: [SQL] weird structure

2000-08-25 Thread Renato De Giovanni
> > Consider the following tables/fields: > > table "person": fields "p_id", "p_name". > > table "person_attribute": fields "a_id", "a_name". > > table "person_data": fields "d_person_id", "d_attribute_id", > > "d_value". > > > > Also consider that a person may not have data related to all possibl

Re: [SQL] weird structure

2000-08-24 Thread Yury Don
[EMAIL PROTECTED] wrote: > > Hi, > > Consider the following tables/fields: > table "person": fields "p_id", "p_name". > table "person_attribute": fields "a_id", "a_name". > table "person_data": fields "d_person_id", "d_attribute_id", > "d_value". > > Also consider that a person may not have dat

Re: [SQL] weird structure

2000-08-24 Thread Renato De Giovanni
Yes, Ryan, the idea is to use only one row with all attributes in it. The structure I described is easy to use when you want to know the attributes of a single person, and in this case your suggestion is the way to go - I knew that. I asked the question considering a specific person_id just to s

Re: [SQL] weird structure

2000-08-24 Thread Ryan Williams
Does it have to be in one row? Otherwise, assuming that person_data.d_person_id references person.a_id and person_data.d_attribute_id references person_attribute.a_id: select a.a_name from person p, person_data d, person_attribute a where p.p_name = 'UserYou'reLookingFor' AND p.p_id = d.d_person