title: Multiple relations in MySQL DB
body: <p>As an introductory project for my school subject, I was requested to create an app for showing the list of shops in my country with the possibility to sort it by location and category. What is more, it should not be just a static text, as a user may add his/her own shops to the list.</p>
  
  <p>Although I am not experiencing any problems with the UI and functionality of my Java application, I am a complete newbie to databases and, particularly, to MySQL. Even though I have scrutinized some tutorials, I still keep toiling over one indeed primitive issue.</p>
  
  <p>The problem is:</p>
  
  <p>I created a table "Shop" with columns "id"(the primary key with auto increment), "name"(text type), "type"(text type) and "location"(text type).</p>
  
  <p>Alike, two more tables were made: </p>
  
  <p>1) "Types" which contains "id" again as the primary key and "type". For example: </p>
  
  <pre><code>id   type
  1    supermarket
  2    grocery
  3    bookshop
  </code></pre>
  
  <p>2) "Location" with "id" too and "city". Something like this:</p>
  
  <pre><code>id   city
  1    London
  2    Nottingham
  3    Southampton
  </code></pre>
  
  <p>What I attempted to do is to create "many to 1" relation between "Types"/"Location" and "Shop" tables (or "1 to 1" between "Types" and "Shop" as well as "Location" and "Shop"), because further I would want to sort shops by location and type and, consequently, print list of relevant shops in my app. However, I simply cannot find the logical sequence how to implement those connections.</p>
  
  <p>Looking forward to any tips.
  Thanks in advance!</p>