我正在创建一个非常相似的数据库,以跳过菜肴,菜单上的每个项目都添加ons(例如:添加色拉)。我想和他们一起在配菜的地方一起吃饭。如果你们可以从视觉上向我展示,因为很难想像,尤其是当我还不熟悉这一点时。 所以我要问的重点是
Table1(Food)
co1(food_name) col2(price)
Salmon 9.95
Beef with rice 11.50
Turkey 13.95
Chicken 9.95
Table2(Add-on)
col1(addon_name) col2(food_name) col3(price)
side salad salmon 2.50
side rice salmon 2.50
side potatoes salmon 2.50
gravy beef with rice 1.50
side potatoes beef with rice 2.50
side rice Turkey 2.50
gravy Turkey 1.50
gravy Chicken 1.50
所需结果的示例
salmon|9.95|side salad|2.50|side rice|2.50|side potatoes|2.50
Turkey|9.95|side rice|2.50|gravy|1.50
Chicken|9.95|gravy|1.50