Re: Database naming convention (yet another post of it, but a bit different)
Date: Thu, 10 Oct 2002 09:43:02 +0100
Message-ID: <ao3ep0$4rd$1$8302bc10_at_news.demon.co.uk>
> >> I prefer the singular. :) Especially when it comes to cases where
> we have a table with one row. <<
>
> Then use a singlular name and enforce this rule with a constraint:
>
> CREATE TABLE PhysicalConstants
> (lock INTEGER NOT NULL PRIMARY KEY
> DEFAULT 0
> CHECK (lock = 0),
> pi FLOAT NOT NULL,
> e FLOAT NOT NULL,
> ...);
>
> INSERT INTO PhysicalConstants
> VALUES (1, 3.141592653, ...);
Slightly OT but...
Are 1 row tables a good idea for storing settings? I usually set up the
following table(s) to store settings in a database:
Setting(pk) Value pi 3.14159265 maxReportSize 90 case 12
etc....
then another (sometimes I store numeric and text values in the same column) for text settings:
Setting(pk) Value companyName Bums&Legs Co.
etc...
What are the advantages / disadvantages with this structure compared to a one row table for storing settings. I realise my design is not normalised (at all!) but it seems to work well.
Cheers
Stu
Received on Thu Oct 10 2002 - 10:43:02 CEST