By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
id | name | vendor | stock | area |
---|---|---|---|---|
1 | test1 | vendor1 | 5 | 1 |
2 | test2 | vendor2 | 2 | 2 |
3 | test3 | vendor3 | 3 | 3 |
4 | test4 | vendor4 | 1 | 4 |
5 | test5 | vendor5 | 4 | 5 |
total_id | name | vendor | num | outnum | purchase_at | ship_at |
---|---|---|---|---|---|---|
1 | test1 | vendor1 | 2 | 0 | 2020-09-02 | null |
1 | test1 | vendor1 | 3 | 0 | 2020-09-02 | null |
3 | test3 | vendor3 | 1 | 0 | 2020-09-02 | null |
3 | test3 | vendor3 | 2 | 0 | 2020-08-05 | null |
3 | test3 | vendor3 | 1 | 0 | 2020-09-02 | null |
3 | test3 | vendor3 | 0 | 3 | null | 2020-08-05 |
3 | test3 | vendor3 | 0 | 4 | null | 2020-09-04 |
area | id | name | vendor | stock | num | outnum |
---|---|---|---|---|---|---|
1 | 1 | test1 | vendor1 | 5 | 5 | null |
2 | 2 | test2 | vendor2 | 2 | null | null |
3 | 3 | test3 | vendor3 | 3 | 2 | 4 |
4 | 4 | test4 | vendor4 | 1 | null | null |