# Multiple Tables for ONE location

**URL:** <https://www.ruby-forum.com/t/multiple-tables-for-one-location/121373>\
**Category:** Rails\
**Created:** [November 27, 2007, 12:41pm UTC](https://www.ruby-forum.com/t/multiple-tables-for-one-location/121373 "2007-11-27T12:41:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![quigebo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/838e76/32.png) [@quigebo](https://www.ruby-forum.com/u/quigebo)\
**Post date:** [November 27, 2007, 12:41pm UTC](https://www.ruby-forum.com/t/multiple-tables-for-one-location/121373/1 "2007-11-27T12:41:57Z")

</div>

Hey,

I was wondering how I should create my database. I am going to have a  
‘location’ model, which has Address, State, Zip, Lat, Lng, Country and  
vaguely remember from one class a long time ago that each table should  
have information that is specific to the table itself. So should I  
just create one locations table that has all of that information or  
should I break it down into a State, City, Country, Zip (both lat/  
lng), and Location (street address) tables? Thanks

---

<div class="post-metadata">

**Author:** ![quigebo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/838e76/32.png) [@quigebo](https://www.ruby-forum.com/u/quigebo)\
**Post date:** [November 28, 2007, 4:03pm UTC](https://www.ruby-forum.com/t/multiple-tables-for-one-location/121373/2 "2007-11-28T16:03:26Z")

</div>

I also figured if I broke the ‘location’ down into different city/  
state/country tables, then I could do something like:

@users = User.find(:all, :conditions =\> [‘state\_id = ?’,  
State.find\_by\_name(“IL”).id[)

vs.

@users = User.find(:all, :include =\> :locations, :conditions =\>  
[‘state\_name = “IL”’])

–is this right?
