Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2013
    Location
    India
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,447
    Thanks
    76
    Thanked 4,372 Times in 4,337 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •