DESCRIBE DATABASE¶
데이터베이스를 설명합니다. 예를 들어, 데이터베이스의 스키마를 표시합니다.
DESCRIBE는 DESC로 축약할 수 있습니다.
- 참고 항목:
ALTER DATABASE , CREATE DATABASE , DROP DATABASE , SHOW DATABASES , UNDROP DATABASE
DATABASES 뷰 (Information Schema)
구문¶
DESC[RIBE] DATABASE <database_name>
매개 변수¶
database_name설명할 데이터베이스의 식별자 를 지정합니다.
사용법 노트¶
이 명령의 출력을 후처리하기 위해 파이프 연산자 (
->>) 또는 RESULT_SCAN 함수를 사용할 수 있습니다. 두 구문 모두 출력을 쿼리할 수 있는 결과 세트로 간주합니다.For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.
When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column
type, specifySELECT "type".You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.
예¶
DESCRIBE DATABASE 명령을 보여주는 예입니다.
CREATE DATABASE desc_demo;
CREATE SCHEMA sample_schema_1;
CREATE SCHEMA sample_schema_2;
DESCRIBE DATABASE desc_demo;
+-------------------------------+--------------------+--------+
| created_on | name | kind |
|-------------------------------+--------------------+--------|
| 2022-06-23 00:00:00.000 -0700 | INFORMATION_SCHEMA | SCHEMA |
| 2022-06-23 00:00:00.000 -0700 | PUBLIC | SCHEMA |
| 2022-06-23 01:00:00.000 -0700 | SAMPLE_SCHEMA_1 | SCHEMA |
| 2022-06-23 02:00:00.000 -0700 | SAMPLE_SCHEMA_2 | SCHEMA |
+-------------------------------+--------------------+--------+