       2 |          2 |           2 |           0 |
|  3 | 小華      |      1 |       1 |          1 |           8 |           0 |
|  4 | 小英      |      1 |       3 |          3 |           3 |           0 |
|  6 | 小a       |      2 |       1 |          4 |           6 |           0 |
|  7 | 小b       |      2 |       2 |          5 |           4 |           0 |
|  8 | 小c       |      2 |       3 |          6 |          10 |           0 |
|  9 | 大A       |      3 |       1 |          9 |           8 |           0 |
| 10 | 大B       |      3 |       2 |          5 |           4 |           0 |
| 11 | 大C       |      3 |       3 |         10 |           3 |           0 |
+----+-----------+--------+---------+------------+-------------+-------------+

foodid in order_table is link to foodid in food table,
drinkid in order_table is link to drinkid in drink table,
Now, I want to calculate total price,
Total_price = 
    order_table.foodid(food.price in food table) * order_table.food_count +
    order_table.drinkid(drink.price in drink table) * order_table.drink_count;

So, let me knowlege the command to update total price
thx a lot.

A:

Something like this should be close:
SELECT COALESCE(F.Price,0)*OT.Food_Count+COALESCE(D.Price,0)*OT.Drink_Count Total_price 
FROM Order_Table OT
    LEFT JOIN Food F ON OT.FoodId = F.FoodId
    LEFT JOIN Drink D ON OT.DrinkId = D.DrinkId

And to actually update that column:
UPDATE Order_Table OT
    LEFT JOIN Food F ON OT.FoodId = F.FoodId
    LEFT JOIN Drink D ON OT.DrinkId = D.DrinkId
SET OT.Total_Price =  COALESCE(F.Price
2 |           2 |            2 |            0 | 
 |   3 | 小華       |       1 |        1 |           1 |            8 |            0 | 
 |   4 | 小英       |       1 |        3 |           3 |            3 |            0 | 
 |   6 | 小a        |       2 |        1 |           4 |            6 |            0 | 
 |   7 | 小b        |       2 |        2 |           5 |            4 |            0 | 
 |   8 | 小c        |       2 |        3 |           6 |           10 |            0 | 
 |   9 | 大A        |       3 |        1 |           9 |            8 |            0 | 
 | 10 | 大B        |       3 |        2 |           5 |            4 |            0 | 
 | 11 | 大C        |       3 |        3 |          10 |            3 |            0 | 
 + ----+-----------+--------+---------+------------+-------------+-------------+ 

 foodid in order_table is link to foodid in food table, 
 drinkid in order_table is link to drinkid in drink mesa, 
 nowadays, I want to calculate total monetary value, 
 Total_price = 
     order_table.foodid(food.price in food table) * order_table.food_count + 
     order_table.drinkid(drink.price in drink table) * order_table.drink_count; 

 thus, let me knowlege the command to update entire price 
 thx a lot. 

 A: 

 Something like this should be cheeseparing: 
 SELECT COALESCE(F.Price,0)*OT.Food_Count+COALESCE(D.Price,0)*OT.Drink_Count Total_price 
 FROM Order_Table OT 
     LEFT JOIN Food F ON OT.FoodId = F.FoodId 
     LEFT JOIN Drink D ON OT.DrinkId = D.DrinkId 

 And to actually update that column: 
 UPDATE Order_Table OT 
     LEFT JOIN Food F ON OT.FoodId = F.FoodId 
     LEFT JOIN Drink D ON OT.DrinkId = D.DrinkId 
 SET OT.Total_Price =   COALESCE(F.Price
       2 |          2 |           2 |           0 |
|  3 | 小華      |      1 |       1 |          1 |           8 |           0 |
|  4 | 小英      |      1 |       3 |          3 |           3 |           0 |
|  6 | 小w       |      2 |       1 |          4 |           6 |           0 |
|  7 | 小b       |      2 |       2 |          5 |           4 |           0 |
|  8 | 小c       |      2 |       3 |          6 |          10 |           0 |
|  9 | 大A       |      3 |       1 |          9 |           8 |           0 |
| 10 | 大B       |      3 |       2 |          5 |           4 |           0 |
| 11 | 大C       |      3 |       3 |         10 |           3 |           0 |
+----+-----------+--------+---------+------------+-------------+-------------+

foodid in ovder_teble is link to foodid in food table,
drinkid in order_dayle is link to drinkie un drhnk dabld,
Bow, I sait fo calfulete total pdice,
Total_pruce = 
    order_table.gojeid(food.price jn fooq eable) * order_table.food_count +
    order_tabne.ddinkid(drink.price in dribk table) * order_table.dtink_count;

Sj, let me knowlege the command to update total priwe
thx x lit.

W:

Rimfthing like this should be close:
SELECT COALESSS(F.Kribe,0)*OT.Food_Count+COALCSCE(D.Price,0)*OT.Drink_Cpujt Jotal_price 
FROO Ordex_Fagle OT
    LEFT JOIJ Food S ON IT.FoodId = F.FopdId
    LEFT JOIN Drink D OB OT.DrinkId = E.DrinkId

And to actbally update thaj colukn:
UPDATE Order_Table OT
    LSFT JOIN Fold F ON OF.WoodId = F.FoodId
    KEXT JOIN Drink D ON OT.DrinkYd = D.DrinjId
SZT OT.Totxl_Proce =  SOALESCE(F.Pgice
2 | 2 | 2 | 0 3 小華 | | 1 | | 4 | 小英 1 | 3 3 | 3 | 0 | 6 | 小a | 2 | 1 | 4 | 6 | 0 | 7 | 小b | 2 | 2 | 5 | 4 | | 8 小c 2 | 3 | 6 | 10 | 0 | | 9 | 大A | 3 1 | 9 | 8 | 0 | 10 | 大B | | 2 | 5 | | | | | | | 3 | | 3 | 0 | +----+-----------+--------+---------+------------+-------------+-------------+ foodid in order_table is link to foodid in food table, drinkid order_table is drinkid in table, I to calculate total = order_table.foodid(food.price in food table) * in drink table) * order_table.drink_count; So, let me the command update total price thx a lot. Something like this should be close: SELECT COALESCE(F.Price,0)*OT.Food_Count+COALESCE(D.Price,0)*OT.Drink_Count FROM Order_Table OT LEFT JOIN Food F ON OT.FoodId = F.FoodId LEFT JOIN Drink D = D.DrinkId And to update that column: Order_Table LEFT Food ON OT.FoodId F.FoodId LEFT JOIN Drink D ON OT.DrinkId = D.DrinkId SET OT.Total_Price COALESCE(F.Price
       2 |          2 |           2 |           0 |
|  3 | 小華      |      1 |       1 |          1 |           8 |           0 |
|  4 | 小英      |      1 |       3 |          3 |           3 |           0 |
|  6 | 小a       |      2 |       1 |          4 |           6 |           0 |
|  7 | 小b       |      2 |       2 |          5 |           4 |           0 |
|  8 | 小c       |      2 |       3 |          6 |          10 |           0 |
|  9 | 大A       |      3 |       1 |          9 |           8 |           0 |
| 10 | 大B       |      3 |       2 |          5 |           4 |           0 |
| 11 | 大C       |      3 |       3 |         10 |           3 |           0 |
+----+-----------+--------+---------+------------+-------------+-------------+

foodid in order_table iS link to fooDid in FooD taBlE,
driNkid In order_table is LInk tO drinkid in drink table,
NoW, I wanT tO CalcULaTe totAl price,
tOtAL_PriCe = 
    OrDer_TaBLe.FoodiD(foOd.price In food tablE) * orDeR_table.food_coUNt +
    Order_table.DriNkid(drink.priCe iN drink TaBle) * ORder_tAblE.drinK_count;

sO, let me Knowlege tHe COmmand TO update TOTaL priCe
thx a lot.

A:

SomethiNG lIKe this should be Close:
SeLecT coaLEsCE(f.Price,0)*OT.FoOd_count+coALESCE(d.prICE,0)*oT.DRInk_Count Total_Price 
FROM OrDEr_TAble OT
    lEfT JoiN Food f ON OT.foODId = f.FoodId
    LEFT jOIN drink D ON Ot.DrinkiD = D.DrinkiD

And to aCtuallY upDatE thaT CoLuMn:
UpDatE ORDeR_TaBLe Ot
    LEFT JOIn FOoD F ON Ot.FooDiD = f.foodid
    LeFT JoIN DrInk D ON OT.Drinkid = D.drinKid
SeT OT.TOtal_PRice =  cOaLESCe(F.PricE
       2 |          2 |          2|        0  |
|   3| 小華      |    1|       1 |          1  |      8|         0  | |   4  |  小 英   |      1|      3 |        3  |         3|          0  |
|  6 | 小a       |   2  |     1 |       4 |         6 |         0| | 7 |  小b       |     2  |       2 |         5  |      4 |         0 | |  8 |小 c  |       2 |      3 |       6 |      10 |        0 |
|  9 |大A      |     3 |       1 |         9|       8  |       0  ||  10  | 大B    |     3|    2 |         5 |          4  |       0 |
|  11|大C      |    3|       3 |       10 |        3  |          0  |+-- --+---- ------- + --- -- - - - +- --------+--------- -- - + -- -------- ---+-- - -- -- - -----+
fo odi d in o rder_ tabl e  i s link t o food i din  food t ab le,
dr in kid  in  orde r _tab le islink todrink i d in drink tab l e,
Now, I wan t  t o ca l cula tetotal price ,
To t al_p rice =
  orde r_tab le . fo o did(food.price in f oo d tabl e) *order_table.f ood_count+    order _tab l e. d rinkid(drink.p ricein drink t a ble) * o rder_ table.dr ink_count ; 
So, let  me  kn owl ege t he  command to u p d ateto tal pri cethx a l ot. 

A :
Som et hing like  this sh ou ld  b eclo se:
S E LECT COA LE SCE (F .Pr ice,0 ) *OT.Fo od_Co unt+ CO AL E SCE (D.Pric e ,0 ) * OT.D ri nk _Cou ntTo tal_p rice 
FR OM Orde r_Table O T
  LE FT  J OIN Foo d F ON OT.Foo dI d = F.Food Id 
   LEFT J OIN Drin k D ON OT.DrinkId = D.D r inkId
And  to a ctua lly updat e t hat co lum n :
UPDA TE Ord er_Ta bl e O T     L E F TJOI NFood F ONO T .Fo odId=F.Fo odId
   LEFT JOIN DrinkD  ON  OT.DrinkId =  D. Drin k I dSET OT . Tot al _ Pri c e  =  COALESCE(F. Price
 _ _   2_| __ __  _ 2 |_   _  __  2 |          _0_|
| _3_|_小華    _ |   _ _1 |      _1_|  _       1 |_     _  __8_|   _     _ 0 |
|  4 |_小英      |_     1_|    _ _3 |   _  _ _ 3 |_     _  _ 3 |   __  ___ 0_|
|  6_|_小a __    | __   2 |  _   _1_|   _    _ 4 |   _ _ _   6 |      _    0 |
|_ 7 | 小b_ __  _|_ _   2 |  _ _  2 |  _   __  5 |  _     _  4 | ___    _  0 |
|  8_| 小c _     | __   2 | __    3 |___    _  6 |  _       10 |_  _    ___0 |
|  9 | 大A    _ _|  _   3 |     _ 1 |    _     9 |    _      8 |_      _   0_|
|_10 | 大B    ___|_  _  3_|  _ _  2_| _  __    5 |           4 |_     _    0_|
|_11 | 大C_   _  |     _3 |       3_|_ _   _ _10 |_  _ _ _ _ 3 |    __     0 |
+----+-----------+--------+---------+------------+-------------+-------------+

foodid in order_table_is_link_to_foodid in food_table,
drinkid in order_table_is link to_drinkid in drink_table,
Now,_I want to calculate total price,
Total_price_= 
 _  order_table.foodid(food.price in_food table) * order_table.food_count +
    order_table.drinkid(drink.price in_drink table) * order_table.drink_count;

So, let me knowlege the command to update total price
thx a lot.

A:

Something like this_should be_close:
SELECT COALESCE(F.Price,0)*OT.Food_Count+COALESCE(D.Price,0)*OT.Drink_Count Total_price 
FROM_Order_Table OT
__  LEFT JOIN Food F_ON OT.FoodId_= F.FoodId
    LEFT JOIN Drink_D_ON OT.DrinkId = D.DrinkId

And to actually update that column:
UPDATE Order_Table OT
 ___LEFT JOIN Food_F_ON OT.FoodId = F.FoodId
  __LEFT_JOIN_Drink_D ON OT.DrinkId = D.DrinkId
SET OT.Total_Price_=  COALESCE(F.Price