且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我是否过度设计了MySQL数据库(用户/公司/产品)?

更新时间:2022-02-10 09:54:05

至少对我来说很好,很规范.

Looks good, well normalised, to me at least.

我注意到每种产品只能属于一个公司.如果那是您的预期,那还好,否则您可以让产品拥有自己的PID并具有product_company关系表,该表可以让多个公司销售特定产品.取决于谁管理我猜的产品.

I notice that each product can only belong to one company. If that's what you intended that's fine, otherwise you could have product have its own PID and have a product_company relation table, which would let more than one company sell a particular product. Depends who administers the products I guess.

我确实注意到,用户表称为用户"(复数),其他表则为单数(公司",产品").不过那只是小事.

I did notice that the user table is called 'users' (plural) and the others are singular ('company', 'product'). That's only a minor thing though.