[오라클]주석문 달기

심심이·2024년 3월 1일

oracle

목록 보기
25/40

1) 테이블 주석문 달기

COMMENT ON TABLE 테이블명
IS '주석문내용'; 

2) 실습


select *
from user_tab_comments; -- 주석문들을 볼 수 있다



create table tbl_jikwon
    (sano    number
    ,saname  Nvarchar2(10) not null
    ,salary  number(6) default 100 not null
    ,comm    number(5)
    ,constraint PK_tbl_jikwon_sano primary key(sano)
    );
-- Table TBL_JIKWON이(가) 생성되었습니다.

COMMENT ON TABLE tbl_jikwon
IS '우리회사 사원들의 정보가 들어있는 테이블'; -- 원래 더 꼼꼼하게 쓰기
-- Comment이(가) 생성되었습니다.

1) 칼럼 주석문 달기


comment on column 테이블명.칼럼명;

2) 실습


comment on column tbl_jikwon.sano is '사원번호 primary key'; -- Comment이(가) 생성되었습니다.
comment on column tbl_jikwon.saname is '사원명'; -- Comment이(가) 생성되었습니다.
comment on column tbl_jikwon.salary is '기본급여 기본값은 100'; -- Comment이(가) 생성되었습니다.
comment on column tbl_jikwon.comm is '수당 null 허락함'; -- Comment이(가) 생성되었습니다.


select *
from user_col_comments
where table_name = 'TBL_JIKWON'; -- 칼럼 주석문 조회하기
profile
개발하는 심심이

0개의 댓글