Spring 강의/DB
[스프링 DB 2편] - (1) 데이터 접근 기술
lxexjx
2022. 8. 28. 19:54
[데이터베이스 테이블 생성] - 메모리가 아닌 DB에 데이터를 보관하는 방법
<item테이블 생성>
drop table if exists item CASCADE;
create table item
(
id bigint generated by default as identity,
item_name varchar(10),
price integer,
quantity integer,
primary key (id)
);
<등록쿼리>
insert into item(item_name, price, quantity) values ('ItemTest', 100, 10)