본문 바로가기
언어/SQL

[Oracle] 테이블 create, 속성 보기와 comment하기

by 코딩맛집 2024. 5. 22.

1. Create 문

create table [schema].[table](
	[col_nm] [type] [default ~] [not null]
	work_dt char(8) default to_char(sysdate, 'yyyyMMdd') not null,
	finish_yn char(1) not null,
	err_desc varchar(4000),
	create_dtm timestamp default sysdate not null
)

 

2. 테이블 속성 보기

desc [schema].[table];

 

3. 테이블 Comment

comment on table [schema].[table] is 'table_nm'; -- table's comment
comment on column [schema].[table].[column] is 'col_nm'; --col's comment