title: Data Modeling: hierarchy of geographic locations
body: <p>I want my users to be able to specify their locations so that I can plot them on a map. Given an address, I use Google Maps API to get their lat/long coordinates and store that in the database.</p>
  
  <p>Additionally, I want to allow users to search for other users based on location. Using Google Maps API, I can also get, say, country/state/city for address (or lat/long coordinates). My problem is that I don't know how to store country/state/city in such a way that:</p>
  
  <ul>
  <li>The data is associated to a particular user</li>
  <li>There is no data redundancy</li>
  </ul>
  
  <p>The problem I think is if User-1 and User-2 both enter an address that results in the country being "USA", I think I need to know that User-1 and User-2 are both from the USA -- AND that "USA" is only stored once in the DB.</p>
  
  <p>When users search for other users, I think I should only let them search for users in the USA if I actually have users from USA. Meaning, assume User-1 and User-2 are the only 2 users from the USA, if User-1 and User-2 delete their profiles, I shouldn't allow searches for users in the USA anymore.</p>
  
  <p>Are my ideas conceptually wrong? In any case, how should I model this information? I'm using MySQL.</p>