> For the complete documentation index, see [llms.txt](https://docs.sysout.co.kr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sysout.co.kr/database/oracle/structure-query-language/user-query/manage-data/update-data.md).

# 데이터 수정

## 데이터 수정

데이터 수정은 `Update`라는 명령을 사용한다. 테이블은 select에서 사용한 `product` 테이블을 그대로 사용한다.

### 형식

```sql
update 테이블이름 set 항목=값, 항목=값, ... [where 조건];
```

조건은 생략이 가능하지만 생략할 경우 전체가 수정되므로 가급적 작성하는 것이 좋다.

### 예제

모든 상품 가격을 100원 증가

```sql
update product set price = price + 100;
```

유통기한이 1달 이내로 남은 상품의 가격을 5% 할인

```sql
update product set price = price * 0.95 where expire - sysdate between 0 and 30;
```
