If infinite toppings aren't needed, you can include several topping fields in the Pizza table (topping_1, topping_2, and so on).
如果不需要如此多的浇头,则可以将若干个浇头字段包括在比萨表中(topping_1、topping_2等等)。
Classic database normalization would say to create a pizza table, and then a many-to-many table relating pizza IDs to topping IDs.
典型的数据库标准会建议需要先创建一张比萨表,然后再创建一张将比萨id与浇头id关联起来的多对多表。
You'd want to allow enough toppings on a pizza that putting them all in the same table would become rather ugly.
您希望对一个比萨使用足够多的浇头,将它们全都放在同一张表中会变得十分难看。
应用推荐