title: Database table structure for a food and restaurant searching/filtering application
body: <p>I am building an food listing application using PHP as backend and mysql as database. I have created three tables for searching. Below are the tables:</p>
  
  <pre><code>ADD RESTAURANT
  id (AI primary)
  res_id
  name
  description
  
  
  FOOD CATEGORY (eg chinese, indian)
  id (primary AI)
  cat_id
  res_id
  category_name
  
  FOOD SUB CATEGORY (eg noodles, chilly chicken )
  id (PRIMARY AI)
  cat_id
  sub_id
  name
  price
  </code></pre>
  
  <p>How do I link these three tables such as when somebody searches for a specific food item it displays the shop from the first table, if searched by category then it displays the shop name also if searched by sub category name then also displays the shop name. Any kind of help would be appreciated. </p>