MySQL Forums
Forum List  »  MySQL Workbench

Re: Best practice - variable number of fields
Posted by: Exception e
Date: July 04, 2009 06:58AM

> Should I have separate integer fields to record their hobbies, like "Hobby1", "Hobby2"

Never.

> or should I have just one varchar field "Hobby" where I concatenate the hobbies separated by semicolons?

Not good either, or it is data you never use. When you're going to search people on their hobbies, you need three tables
hobby
user
user_hobby

user_hobby contains the primary key from user and the primary key from hobby.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Best practice - variable number of fields
2055
July 04, 2009 06:58AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.