Re: Need help with a college SQL exam question... - Mailing list pgsql-sql

From Roland Roberts
Subject Re: Need help with a college SQL exam question...
Date
Msg-id m2667nrqj2.fsf@tycho.rlent.pnet
Whole thread Raw
In response to Re: Need help with a college SQL exam question...  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-sql
>>>>> "Josh" == Josh Berkus <josh@agliodbs.com> writes:
   Josh> It's  doable.  Just think "nested subselects"  and heavy use   Josh> of  the HAVING  clause.  They're also
screwingwith  you by   Josh>  providing an irrelevant  table (shop)  and not  providing a   Josh> relevant table
(makers). If I was the professor, I'd give   Josh> the question writer a D+ for database design ...
 

I would treat the table car_model as providing a complete list of
makes as well, i.e., "select distinct make from car_model" provides a
list of all car makes (from which the customer can borrow).

I'd agree that the database *should* have a makers table to constrain
the values of that column.  A real-life database without it is prone
to *lots* of data entry errors (let's see, should I put in GM, Chevy
or Chevrolet?).

roland
--            PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
roland@rlenter.com                     76-15 113th Street, Apt 3B
roland@astrofoto.org                       Forest Hills, NY 11375


pgsql-sql by date:

Previous
From: Manuel Trujillo
Date:
Subject: problems with this wiew
Next
From: "Josh Berkus"
Date:
Subject: Re: need some help understanding sloq query