Oracle/[YT] 오라클 실습

#2. Table 생성

고인돌개발자 2021. 9. 12. 00:06

1. 테이블 구성

 

<오라클 테이블 생성>


2. 테이블 생성 스크립트 

 

 

-- 고객계정
create table yt_customer(
user_id	varchar2(200),
passwd	varchar2(200),
user_nm	varchar2(200),
mobile	varchar2(200),
email	varchar2(200),
juso	varchar2(200),
reg_day	date default sysdate,
modi_day	date,
CONSTRAINT pk_customer PRIMARY KEY(user_id)
)
;

-- 상품정보
create table yt_product(
prd_id	varchar2(200),
prd_nm	varchar2(200),
spec	varchar2(200),
maker	varchar2(200),
model	varchar2(200),
price_sale	number(15,2),
price_buy	number(15,2),
reg_day	date default sysdate,
modi_day	date,
CONSTRAINT pk_product PRIMARY KEY(prd_id)
)
;


-- 주문정보
create table yt_order_info(
ord_no	varchar2(200),
user_id	varchar2(50),
prd_id	varchar2(50),
price_sale	number(15,2),
price_buy	number(15,2),
juso	varchar2(200),
memo	varchar2(500),
reg_day	date default sysdate,
modi_day	date,
CONSTRAINT pk_order_info PRIMARY KEY(ord_no)
)
;