would the table look like this:
...
or like this:
Neither, because a single table is not the way to do this.
Instead, you need 3:
create table person
{
id int auto_increment primary key,
name text
};
create table interest
{
id int auto_increment primary key
name text
};
create table person_interest
{
person_id, / references person.id /
interest_id, / references interest.id /
primary key (person_id, interest_id)
}
Getting the data back out is harder in mysql than it should be, however, due to the lack of subqueries. Ideally (and in any fully-compliant sql dbms) you can say:
select person.id, person.name from person,person_interest where person.id = person_interest.person_id and person_interest.interest_id = (select id from interest where name = 'php programming');
However, in real life, you may already know the value of 'interest.id' for a particular query, and thus can skip it. (If not, the mysql way is to just perform the 2 queries in sequence. This is not too bad in a case like my example, where the subquery is going to return a single row only.)
}
id : name : bike : ski : run
1 : chris: 1 : 1 : 0
or like this:
id : name : interests
1 : chris: bike ski