inblog logo
|
sxias
    데이터베이스

    [데이터베이스] 6. 데이터 조작 (DML)

    문정준's avatar
    문정준
    Feb 26, 2025
    [데이터베이스] 6. 데이터 조작 (DML)
    Contents
    1. Insert2. Update3. Delete
    💡
    데이터 조작어 (Data Manipulation Language) ~= CRUD
    • SELECT (선택) → DQL (Data Query Language)
    • UPDATE (갱신)
    • INSERT (삽입)
    • DELETE (삭제)
     

    1. Insert

    • 테이블에 데이터를 추가
    -- INSERT select * from bonus; -- 구조 확인 desc bonus; -- 데이터형에 맞게 데이터 추가 insert into bonus(ename, job, sal, comm) values('홍길동', '프로그래머', 600, 100); insert into bonus(ename, job, sal, comm) values('임꺽정', '변호사', 1000, 200);
    notion image

    2. Update

    • 테이블에 저장된 데이터를 갱신 (수정)
    -- 2. UPDATE update bonus set sal = 2000, comm = 500 where job = '프로그래머'; -- job이 변호사인 친구의 이름을 임하룡으로 변경하시오. update bonus set ename = '임하룡' where job = '변호사';
    notion image
     

    3. Delete

    • 테이블 내에 저장된 데이터 삭제
    -- 3. DELETE delete from bonus where job = '프로그래머';
    notion image
    Share article
    Contents
    1. Insert2. Update3. Delete

    Sxias ㆍ a32176740@gmail.com

    RSS·Powered by Inblog