dbTalk Databases Forums  

Is SQL a good language for this problem ?

comp.databases comp.databases


Discuss Is SQL a good language for this problem ? in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #31  
Old   
Richard Robinson
 
Posts: n/a

Default Re: Is SQL a good language for this problem ? - 07-12-2007 , 09:18 AM






Ed Prochak said:
Quote:
On Jul 11, 2:56 pm, Richard Robinson <richa... (AT) privacy (DOT) net> wrote:
Gene Wirchenko said:
Ed Prochak <edproc... (AT) gmail (DOT) com> wrote:

The point is, in a RELATIONAL database you have a relation between the
primary key and the dependent attributes. IOW, you only need one table
with at least two columns to have a relation.

Nope. You can have a relation with only one column. It would be
purely a lookup, but you could.

Ok. So, a single table having only one column and only one row ... ?

Gene is more of a purist than I am, and Yes, a single column table is
technically a relation. (the number of rows does not matter).
Ok. It'll be a while before I stop finding it unexpected, but I'll get used
to it.

Quote:
makes a good point that I overlooked. If you need a list of something,
say colors, then you can have a COLORS table with one column COLOR,
the PK is that one column. There is no use in creating a ID column to
be the PK. Then you can have a CARS table with a COLOR column that is
a Foreign Key referencing the COLOR column of the COLORS table. That
way you cannot put a COLOR value in the CARS table that is not in the
COLORS table.
Ah. Yes, I can see the point of that; thanks for explaining it.



--
Richard Robinson
"The whole plan hinged upon the natural curiosity of potatoes" - S. Lem

My email address is at http://www.qualmograph.org.uk/contact.html


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.