Database Design Advice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I realize that this is better suited for the MySQL list but I've been unable to
post there for no apparent reason.  My emails to the list owner have gone
unanswered as well, so I appreciate your tolerance with my posting here for the
time being.

I'm setting up a database for a new project and I keep wavering on one aspect of
the design.  The end result is to be a searchable menu for a restaurant's
website and I cannot decide if it is best to simply use one table for all menu
items (food) or use tables for each category (pasta, appetizers, etc).  I
currently
have a table listing said categories (categories) but I simply can't decide
which
is better for this application.  Thank you all for your advice.

Below is some info from MySQL regaring the current design of the DB.

SHOW TABLES;
+---------------+
| Tables_in_tga |
+---------------+
| categories    |
| drinks        |
| food          |
| specials      |
+---------------+

DESCRIBE categories;
+-----------+---------------------+------+-----+---------+----------------+
| Field     | Type                | Null | Key | Default | Extra          |
+-----------+---------------------+------+-----+---------+----------------+
| cat_id    | tinyint(3) unsigned |      | PRI | NULL    | auto_increment |
| cat_name  | char(100)           |      | UNI |         |                |
+-----------+---------------------+------+-----+---------+----------------+

DESCRIBE food;
+------------+---------------------+------+-----+---------+----------------+
| Field      | Type                | Null | Key | Default | Extra          |
+------------+---------------------+------+-----+---------+----------------+
| item_id    | tinyint(3) unsigned |      | PRI | NULL    | auto_increment |
| cat_id     | tinyint(3) unsigned |      |     | 0       |                |
| item_name  | char(50)            |      |     |         |                |
| item_desc  | char(255)           |      |     |         |                |
| item_price | float(5,2)          |      |     | 0.00    |                |
+------------+---------------------+------+-----+---------+----------------+

Thanks again.

Edward Dudlik
Becoming Digital
www.becomingdigital.com





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux