Question: I have a simple task to achieve and I don't know what's the best way of going about it.

I have a Listings table in my DB and I need to associate a list of specification which is a checkbox list the agent has to select.

The table looks something like this.
- id
- size
- type
- location

Now how do I go about storing the checkbox values?
Do I create a new table "Listings\_Specs" and associate each row with "Listings" table via "listing\_id" or should I keep it in "Listings" table and add additional fields to it.

I am using Laravel 4 by the way.

Answer: 
If listing and listing\_specs have a 1 to 1 relationship, then no need for the table listing\_specs, you can add fields to Listing table.

EDIT

```
if you have multiple values in a single field therefore you have to promote this field to a table.
`
Listing:
remove the field for the specs

Listing_specs:
ID | CONTENT | LIST_ID
1  | "fsafs" | 1
2  | "fsafs" | 1
3  | "fsafs" | 1
4  | "fsafs" | 2
5  | "fsafs" | 3`

```
This totally sounds like the kind of thing they might want you to add more of in the future. I'd shy away from creating columns for each specification you plan on tracking.

Instead, it would be a good idea to create a new model called `Specification` with a many-many relationship to `Listings`.

Checked state would then be dependent on a connection existing between `Specification` and `Listing` via the many to many join table.