Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>EDIT</h2> <p>Just noticed you changed your answer. below may not apply anymore, but I'll leave it for future reference...</p> <hr> <p>I would suggest having a separate child table for this.</p> <h2>STORES</h2> <pre><code>auto increment ID | | the store name the store description etc.. | / / / .--------------------------------------------------. | id | name | description | etc | |--------------------------------------------------| | 1 | mary's kitchen | a fancy restaurant | etc | | 2 | willow creek inn | we serve breakfast | etc | '--------------------------------------------------' </code></pre> <h2>STORE_HOURS</h2> <pre><code>auto increment ID | The STORES.id | / the day (0-SUN, 6-SAT) | _________/ / the 24h time OPEN (HH:MM:SS *TIME*) | / _________/ ____/ the 24h time CLOSE (HH:MM:SS *TIME*) | / / / / .----------------------------------------------. | id | store_id | day | time_open | time_close | | 1 | 1 | 1 | 08:30:00 | 20:00:00 | | 2 | 1 | 2 | 08:30:00 | 20:00:00 | | 3 | 1 | 3 | 10:30:00 | 20:00:00 | | 4 | 1 | 4 | 11:00:00 | 20:00:00 | | 5 | 1 | 5 | 08:30:00 | 22:30:00 | '----------------------------------------------' </code></pre> <p>Now, depending on what you want to display, you could query the table:</p> <pre><code>SELECT stores.name AS store_name, stores.description AS store_description, store_hours.day AS store_hours_day, TIME(store_hours.time_open) AS store_open, TIME(store_hours.time_close) AS store_close FROM stores JOIN store_hours ON store_hours.store_id = stores.id </code></pre> <p>Result: <a href="http://sqlfiddle.com/#!2/e6872/8/0" rel="nofollow">http://sqlfiddle.com/#!2/e6872/8/0</a></p> <p>With this table structure and relationship, you can then create granular queries without too much effort.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload