inblog logo
|
gyul
    데이터 베이스

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

    귤's avatar
    귤
    Feb 26, 2025
    [데이터 베이스] 6. 데이터 조작 (DML)
    Contents
    1. DML (데이터 조작어)
    💡
    데이터 조작 언어 (Data Manipulation Language)
    데이터 삽입(Insert) : 데이터 베이스 테이블에 새로운 데이터를 추가한다. (= Post) 데이터 갱신 (Update) : 데이터 베이스 테이블에서 기존 데이터를 수정 또는 갱신한다. (= Put) 데이터 삭제 (Delete) : 데이터 베이스 테이블에서 특정 데이터를 삭제한다. 데이터 조회 (Select) : 데이터 베이스 테이블에서 데이터를 검색하여 조회한다.
    • 미들웨어 : 애플리케이션과 데이터 베이스 서버를 연결해주는 소프트웨어 이다.

    1. DML (데이터 조작어)

    1) INSERT

    -- DML (데이터 조작어) -- 1. Insert select * from bonus; desc bonus; insert into bonus () values(); 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
    notion image

    ✅ Update가 안된다면? → 이렇게 바꿔보자!

    notion image
    notion image

    3) DELETE

    -- 3. Delete delete from bonus where job = '변호사'; delete from bonus where job = '프로그래머';
    notion image
    Share article

    gyul

    RSS·Powered by Inblog