**Book** (B\_ID is PK)

```
| B_ID |   Name  | Unit_Price|
|------+---------+-----------|
|  B01 |   Math  |     25    |
|  B02 | Science |     34    |

```

**Order** (O\_ID is PK)

```
| O_ID |   Date  | Total_Price |
|------+---------+-------------|
| O01  | 12/1/16 |    NULL     |
| O02  | 20/3/16 |    NULL     |

```

**Order Detais** (O\_ID,B\_ID is Composite PK where both ID are FK to tables above )

```
| O_ID | B_ID |  Quantity |
|------+------+-----------|
|  O01 |  B01 |     2     |
|  O01 |  B02 |     1     |
|  O02 |  B02 |     5     |

```

How to insert calculation into `Total_Price`(`Unit_Price` \* `Quantity`) by replacing NULL with the results of calculation. I've tried solve it by using CTE but I don't like that I need to run the CTE again to update it when new record(Exp: O03) is added.