
439
B
장
실습문제 해답
INSERT INTO transaction
(txn_id, txn_date, account_id, txn_type_cd, amount)
VALUES
(1003, now(), 123, 'D', 50);
INSERT INTO transaction
(txn_id, txn_date, account_id, txn_type_cd, amount)
VALUES
(1004, now(), 789, 'C', 50);
UPDATE account
SET avail_balance = available_balance - 50,
last_activity_date = now()
WHERE account_id = 123;
UPDATE account
SET avail_balance = available_balance + 50,
last_activity_date = now()
WHERE account_id = 789;
COMMIT;
B.11
13장
B
.
11
.
1
실습
13
-
1
customer
테이블에서
rental
.
customer
_
id
열에 값이 있는 하나의 행이 삭제되면 오류가 발
생하도록
rental
테이블에 대한
alter
table
문을 작성하세요.
ALTER TABLE rental
ADD CONSTRAINT fk_rental_customer_id FOREIGN KEY (customer_id) ...