0

I am currently working on developing a website that allows users to manage items in their "pantry", "recipe book", "meal plan", and "shopping cart". As each one of these tables can house a large number of unique items, and each is unique to the user, is it more efficient to create new tables for each user, or to simply log the user's ID with each entry in each table?

I ask because I can see a table of 1,000+ pantry items split across 20 users, where hunting for all of them by id may be more costly than simply finding that users table and displaying all the results.

Or is there some other third option I'm not even considering?

Any/all help is appreciated. If more information is needed, please ask.

4

1 回答 1

1

我将创建 1 个数据库,一个用户表(包含他们的“唯一 ID”和元信息),然后为与唯一 ID 关联的每个区域(食品储藏室物品、食谱等)创建一个单独的表。

用户:

ID|Username|Password|RealName....
 1|Jojo    | *******|Joseph

食谱:

ID|Username|Name            |Ingredients    |Prep....
 1|Jojo    |Chicken Tarag.. | 1 pound of... |Prepare ....

轻松愉快。

于 2013-07-05T14:40:15.040 回答