DESCRIBE SCHEMA¶
스키마를 설명합니다. 예를 들어, 스키마의 테이블과 뷰를 나열합니다.
DESCRIBE는 DESC로 축약할 수 있습니다.
- 참고 항목:
ALTER SCHEMA , CREATE SCHEMA , DROP SCHEMA , SHOW SCHEMAS , UNDROP SCHEMA
SCHEMATA 뷰 (Information Schema)
구문¶
DESC[RIBE] SCHEMA <schema_name>
매개 변수¶
schema_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 SCHEMA 명령을 보여주는 예입니다.
CREATE SCHEMA sample_schema_2;
USE SCHEMA sample_schema_2;
CREATE TABLE sample_table_1 (i INTEGER);
CREATE VIEW sample_view_1 AS
SELECT i FROM sample_table_1;
CREATE MATERIALIZED VIEW sample_mview_1 AS
SELECT i FROM sample_table_1 WHERE i < 100;
DESCRIBE SCHEMA sample_schema_2;
+-------------------------------+----------------+-------------------+
| created_on | name | kind |
|-------------------------------+----------------+-------------------|
| 2022-06-23 01:00:00.000 -0700 | SAMPLE_TABLE_1 | TABLE |
| 2022-06-23 02:00:00.000 -0700 | SAMPLE_VIEW_1 | VIEW |
| 2022-06-23 03:00:00.000 -0700 | SAMPLE_MVIEW_1 | MATERIALIZED_VIEW |
+-------------------------------+----------------+-------------------+