请将ER图转换成符合3NF的关系模式,并给出各关系模式的主码和外码。
答案说明:本题目答案来自网络整理或转载,最终答案请以官网为准。
答 案:userInfo(userID username userTel userEmail orderID)主码userID外码orderID;orderInfo(orderID orderDate itemID)主码orderID外码itemID;itemInfo(itemIDitemNumitemSum)主码itemID;commodityInfo(comIDcomNamecomPricecomDatetypeIDitemID)主码comID外码typeIDitemID;comType(typeIDtypeNamecomID)主码typeID外码comID;
userInfo(userID, username, userTel, userEmail, orderID)主码userID,外码orderID;orderInfo(orderID, orderDate, itemID)主码orderID,外码itemID;itemInfo(itemID,itemNum,itemSum)主码itemID;commodityInfo(comID,comName,comPrice,comDate,typeID,itemID)主码comID,外码typeID,itemID;comType(typeID,typeName,comID)主码typeID,外码comID;