面試題有這樣一個表,表示訂單,面試官問這個表你覺得有什么問題,該怎么解決id name number price total_price1 ip5 5 5000 250002 ip6 4 6000 24000
3 回答

楊__羊羊
TA貢獻1943條經驗 獲得超7個贊
total_price 總金額, 這個無需存入字段 number*price 即可, 這是一個沉余字段, 當然這得看具體的業務邏輯, 不過就算是業務邏輯中需要也可以通過 number*price 計算得出.
令, 細看的話, 不知到這個數據是什么用意, 理論上來說 price 字段不應該是 int 型, 但是從這個給出的數據來開, price 是 int 這是不合邏輯的
添加回答
舉報
0/150
提交
取消