Closed Thread Icon

Topic awaiting preservation: mysql: enum, set difference Pages that link to <a href="https://ozoneasylum.com/backlink?for=24506" title="Pages that link to Topic awaiting preservation: mysql: enum, set difference" rel="nofollow" >Topic awaiting preservation: mysql: enum, set difference\

 
Author Thread
GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 12-26-2004 16:22

can anyone shortly describe what the main difference of the enum and the set type is?

and which one should i use for the category of different products. (toy, book, dvd, ...).
thanks.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 12-26-2004 19:38

neither. You should probably use a foreign key and another table.


In short, sets can have multiple members, while an enum can have only one.
Both are stored as strings.

for further info, see the manual

so long,

->Tyberius Prime

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 12-26-2004 19:53

ok, thanks.

but why should i use another table and not an ENUM?

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 12-26-2004 20:00

Using another table is a much more flexible solution. For example if you add a category you don't need to change the table definition.



.:[ Never resist a perfect moment ]:.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 12-26-2004 20:03

no, but i would have to insert another entry in the category table, which is about the same.

and an extra tablewould take extra memory and computing time, right?

« BackwardsOnwards »

Show Forum Drop Down Menu