DB명세서(Table 명세서) 쿼리로 출력 하기 > 데이터베이스

본문 바로가기
사이트 내 전체검색


회원로그인

데이터베이스

MySQL | DB명세서(Table 명세서) 쿼리로 출력 하기

페이지 정보

작성자 100K5 작성일13-06-28 16:54 조회57,638회 댓글0건

본문

SELECT
   t1.table_name as 테이블 명, t1.table_comment as 테이블설 명, column_name as 컬럼 명,
   data_type as 데이터 유형, column_type as 데이터 길이, column_key as 키,
   is_nullable as 필수, column_default as 초기값, extra as 비고, column_comment as 컬럼설명
FROM
   (SELECT
       table_name, table_comment
    FROM
       information_schema.TABLES WHERE table_schema='데이터베이스_이름') t1,
   (SELECT
       table_name, column_name, data_type, column_type, column_key, is_nullable, column_default, extra, column_comment, ordinal_position
    FROM
       information_schema.COLUMNS WHERE table_schema='데이터베이스_이름') t2
WHERE
    t1.table_name = t2.table_name
ORDER BY
    t1.table_name, ordinal_position;

댓글목록

등록된 댓글이 없습니다.


사이트소개 개인정보취급방침 서비스이용약관 Copyright © kkujunhee.net All rights reserved.
상단으로

개인정보관리책임자 : 관리자

모바일 버전으로 보기