Обсуждение: [offtopic] How do you name a table...

Поиск
Список
Период
Сортировка

[offtopic] How do you name a table...

От
Ognjen Blagojevic
Дата:
Hi,

How do you name a table which sole purpose is to store a list of values?
E.g.

Table: sex
id name
-------
1 male
2 female

Table: day
id name
-------
1 Sunday
2 Monday
3 Tuesday
4 Wednesday
5 Thursday
6 Friday
7 Saturday

Is this:
a. Lookup table
b. Classifier
c. Cypher(er)?

I'm looking for the appropriate term in English.

Regards,
Ognjen

Re: [offtopic] How do you name a table...

От
Ian Barwick
Дата:
2010/4/8 Ognjen Blagojevic <ognjen@etf.bg.ac.rs>:
> Hi,
>
> How do you name a table which sole purpose is to store a list of values?
(...)
> Is this:
> a. Lookup table
> b. Classifier
> c. Cypher(er)?
>
> I'm looking for the appropriate term in English.

I'd call it a lookup-table.


Ian Barwick

Re: [offtopic] How do you name a table...

От
Yeb Havinga
Дата:
Ognjen Blagojevic wrote:
> Hi,
>
> How do you name a table which sole purpose is to store a list of
> values? E.g.
>
> Is this:
> a. Lookup table
> b. Classifier
> c. Cypher(er)?
d. valueset?

regards,
Yeb Havinga


Re: [offtopic] How do you name a table...

От
Karsten Hilbert
Дата:
On Thu, Apr 08, 2010 at 10:16:57PM +0900, Ian Barwick wrote:

> > How do you name a table which sole purpose is to store a list of values?
> (...)
> > Is this:
> > a. Lookup table
> > b. Classifier
> > c. Cypher(er)?

lookup (*_lu, lu_*) or enum or just what it is (gender,
document_type, ...)

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

Re: [offtopic] How do you name a table...

От
Bill Moran
Дата:
In response to Ognjen Blagojevic <ognjen@etf.bg.ac.rs>:

> Hi,
>
> How do you name a table which sole purpose is to store a list of values?
> E.g.
>
> Table: sex
> id name
> -------
> 1 male
> 2 female
>
> Table: day
> id name
> -------
> 1 Sunday
> 2 Monday
> 3 Tuesday
> 4 Wednesday
> 5 Thursday
> 6 Friday
> 7 Saturday
>
> Is this:
> a. Lookup table
> b. Classifier
> c. Cypher(er)?
>
> I'm looking for the appropriate term in English.

I try to make it an ENUM when it's very unlikely to change, i.e. day of
the week is a good candidate for an enum ... when's the last time that
changed?

For lookup tables that aren't static enough to be an enum, it usually
ends up appended with _list (i.e. gender_list, county_list, etc)

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

Re: [offtopic] How do you name a table...

От
Justin Graf
Дата:
On 4/8/2010 9:30 AM, Bill Moran wrote:
> In response to Ognjen Blagojevic<ognjen@etf.bg.ac.rs>:
>
>>
>> Is this:
>> a. Lookup table
>> b. Classifier
>> c. Cypher(er)?
>>
>> I'm looking for the appropriate term in English.
>>
> I try to make it an ENUM when it's very unlikely to change, i.e. day of
> the week is a good candidate for an enum ... when's the last time that
> changed?
>
> For lookup tables that aren't static enough to be an enum, it usually
> ends up appended with _list (i.e. gender_list, county_list, etc)
>
>
As  others have said enum for things that are static like day, week,
month etc..
For things that are not static and change like system/application
settings  i do something like this

CREATE TABLE syssettings
(
   sys_id serial primary key,
   sys_group text,
   sys_value text,
   sys_displayvalue text,
   sys_datatype text DEFAULT 'text'
)

This allows for easy grouping values together and assigning the data
type for casting, along with how the information is to be displayed in
the user interface.

example what the data looks like:  the below data is used to create
<option> pull down list on a website.  So if the user of the application
wants to add more options all they have is make an entry.

15;"ExamLevel";"1";"Level 1";"integer"
16;"ExamLevel";"2";"Level 2";"integer"
17;"ExamLevel";"3";"Level 3";"integer"
18;"QuestionOrder";"StandardList";"Standard not random";"text"
19;"QuestionOrder";"RandomList";"Random from List";"text"
20;"QuestionOrder";"Random";"Random From All Questions";"text"
21;"ExamType";"MPI";"MPI";"char(10)"
22;"ExamType";"RT";"RT";"char(10)"
23;"ExamType";"UT";"UT";"char(10)"
24;"ExamType";"ECT";"ECT";"char(10)"
25;"ExamType";"LPI";"LPI";"char(10)"



All legitimate Magwerks Corporation quotations are sent in a .PDF file attachment with a unique ID number generated by
ourproprietary quotation system. Quotations received via any other form of communication will not be honored. 

CONFIDENTIALITY NOTICE: This e-mail, including attachments, may contain legally privileged, confidential or other
informationproprietary to Magwerks Corporation and is intended solely for the use of the individual to whom it
addresses.If the reader of this e-mail is not the intended recipient or authorized agent, the reader is hereby notified
thatany unauthorized viewing, dissemination, distribution or copying of this e-mail is strictly prohibited. If you have
receivedthis e-mail in error, please notify the sender by replying to this message and destroy all occurrences of this
e-mailimmediately. 
Thank you.