ソースコード
INSERT INTO DEPARTMENT(
    DEPT_CODE,
    START_DATE,
    END_DATE,
    DEPT_NAME,
    LAYER,
    UP_DEPT_CODE,
    VALID_FLG,
    UPDATE_USER_NAME,
    USER_UPDATE_DATETIME
    )
VALUES(
    'B300',
    '2023-04-01',
    NULL,
    '新設部門',
    (SELECT LAYER FROM DEPARTMENT WHERE DEPT_CODE = 'A100'),
    (SELECT UP_DEPT_CODE FROM DEPARTMENT WHERE DEPT_CODE = 'A100'),
    '1',
    (SELECT UPDATE_USER_NAME FROM DEPARTMENT WHERE DEPT_CODE = 'A100'),
    '2023-04-01 00:00:00'
    )
;

UPDATE DEPARTMENT SET
    END_DATE = '2023-03-31',
    VALID_FLG = '0',
    UPDATE_USER_NAME = 'ORG_CHG',
    USER_UPDATE_DATETIME = '2023-03-31 23:59:59'
WHERE
    DEPT_CODE IN ('A100','A200')
;

UPDATE EMP SET
    DEPT_CODE = (SELECT DEPT.DEPT_CODE FROM DEPARTMENT DEPT WHERE DEPT.DEPT_CODE ='B300'),
    START_DATE = (SELECT DEPT.DEPT_CODE FROM DEPARTMENT DEPT WHERE DEPT.DEPT_CODE ='B300'),
    UPDATE_USER_NAME = (SELECT DEPT.DEPT_CODE FROM DEPARTMENT DEPT WHERE DEPT.DEPT_CODE ='B300'),
    USER_UPDATE_DATETIME = (SELECT DEPT.DEPT_CODE FROM DEPARTMENT DEPT WHERE DEPT.DEPT_CODE ='B300')
WHERE
    DEPT_CODE IN ('A100','A200')
AND
    VALID_FLG = '1'
;
    
提出情報
提出日時2023/04/14 14:37:49
コンテスト第6回 SQLコンテスト
問題組織変更
受験者MMpine
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量92 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
83 MB
データパターン2
WA
92 MB