<div style="margin:0px;padding:0px;">CREATE TABLE menuorder (</div> <div style="margin:0px;padding:0px;"> product_code INT NOT NULL REFERENCES product(product_code),</div> <div style="margin:0px;padding:0px;"> menu_count INT DEFAULT 1,</div> <div style="margin:0px;padding:0px;"> discount_price INT DEFAULT 0,</div> <div style="margin:0px;padding:0px;"> total_price INT NOT NULL,</div> <div style="margin:0px;padding:0px;"> order_time TIME</div> <div style="margin:0px;padding:0px;"> table_id INT NOT NULL REFERENCES seat(table_id)</div> <div style="margin:0px;padding:0px;">);</div> <div style="margin:0px;padding:0px;"><br></div> <div style="margin:0px;padding:0px;">위와같은 테이블을 생성했습니다. </div> <div style="margin:0px;padding:0px;"><br></div> <div style="margin:0px;padding:0px;">현재 저장된 product_code에 해당하는 price 값과 menu_count 값을 곱하고</div> <div style="margin:0px;padding:0px;">discount_price 값을 뺀 결과를 total_price 에 저장하고싶습니다.</div> <div style="margin:0px;padding:0px;">이러한 기능을 함수? 프로시저? 트리거? 를 활용해서 자동적으로 기입되게 하고 싶습니다.</div> <div style="margin:0px;padding:0px;"><br></div> <div style="margin:0px;padding:0px;">어떤식으로 구현을 해야하는지 이해가 잘 안돼 글올립니다...</div> <div style="margin:0px;padding:0px;"><br style="font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;"></div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.