2016-05-31 2 views

답변

0

구조는 응용 프로그램의 동작에 따라 다를 수 있습니다. 절대적인 방법은 없습니다. 그러나, 나는 당신에게 예를들 그리고 당신은 아이디어를 찾을 수 있습니다

재고 테이블 :

id 
date 
merchandise_id 
amount (negative for exit and positive for entry) 
inventory_id (this is null for entry and includes the id of entry for exits) 

샘플 데이터 :

id |  date  | merchandise_id | amount | inventory_id 
----------------------------------------------------------------- 
1 | 2016-06-01 |  32  | 100 |  NULL 
2 | 2016-06-03 |  32  | -20 |  1 
3 | 2016-06-04 |  32  | -30 |  1 
관련 문제