Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-19-2013, 03:18 PM   PM User | #1
sunilmkt
New Coder

 
Join Date: Jan 2013
Location: India
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
sunilmkt can only hope to improve
How we can represent ENUMs and SETs internally?

Currently I am facing problem with my database. want to represent ENUMs & SETs. does any one have any idea.
sunilmkt is offline   Reply With Quote
Old 01-20-2013, 05:28 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,992 Times in 3,961 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Ummm...

Code:
CREATE TABLE yourtable (
    ageRange ENUM( 'infant', 'toddler', 'child', 'preteen', 'teen', 
                   'young adult', 'adult', 'milddle-aged', 'senior', 'ancient', 'old-pedant' )
);
So enums are easy. But now what KIND of sets are you talking about?

MySQL has a very silly SET datatype, but I don't think it is what you are looking for. But just in case:
http://dev.mysql.com/doc/refman/5.5/en/set.html
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

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

Forum Jump


All times are GMT +1. The time now is 11:27 PM.


Advertisement
Log in to turn off these ads.