INFORMATION_SCHEMA.VIEWS 뷰를 쿼리하면 데이터세트에 있는 각 뷰마다 행이 하나씩 쿼리 결과에 포함됩니다.
INFORMATION_SCHEMA.VIEWS 뷰에는 다음과 같은 스키마가 있습니다.
열 이름
데이터 유형
값
TABLE_CATALOG
STRING
데이터 세트가 포함된 프로젝트 이름
TABLE_SCHEMA
STRING
뷰가 포함된 데이터 세트 이름(또는 데이터 세트 id라고 함)
TABLE_NAME
STRING
뷰 이름(또는 테이블 id라고 함)
VIEW_DEFINITION
STRING
뷰를 정의하는 SQL 쿼리
CHECK_OPTION
STRING
반환되는 값은 항상 NULL
USE_STANDARD_SQL
STRING
뷰가 GoogleSQL 쿼리를 사용하여 생성된 경우 YES, useLegacySql이 true로 설정된 경우 NO
범위 및 구문
이 뷰에 대한 쿼리에는 데이터 세트나 리전 한정자가 포함되어야 합니다. 데이터 세트 한정자가 있는 쿼리에는 데이터 세트에 대한 권한이 있어야 합니다.
리전 한정자가 있는 쿼리에는 프로젝트에 대한 권한이 있어야 합니다.
자세한 내용은 구문을 참조하세요.
다음 표에서는 이 뷰의 리전 범위와 리소스 범위를 설명합니다.
DATASET_ID: 데이터 세트의 ID입니다. 자세한 내용은 데이터 세트 한정자를 참조하세요.
예를 들면 다음과 같습니다.
-- Returns metadata for views in a single dataset.SELECT*FROMmyDataset.INFORMATION_SCHEMA.VIEWS;-- Returns metadata for all views in a region.SELECT*FROMregion-us.INFORMATION_SCHEMA.VIEWS;
예시
예시 1:
다음 예시는 나중에 사용할 수 있도록 예약된 check_option를 제외하고 INFORMATION_SCHEMA.VIEWS 뷰에서 모든 열을 검색합니다. 반환되는 메타데이터는 기본 프로젝트인 myproject의 mydataset에 있는 모든 뷰의 메타데이터입니다.
기본 프로젝트가 아닌 프로젝트에 쿼리를 실행하려면 프로젝트 ID를 `project_id`.dataset.INFORMATION_SCHEMA.view 형식으로 데이터세트에 추가합니다(예: `myproject`.mydataset.INFORMATION_SCHEMA.VIEWS).
다음 예시에서는 기본 프로젝트인 myproject의 mydataset에 있는 myview를 정의하는 데 사용되는 SQL 쿼리와 쿼리 구문을 검색합니다.
기본 프로젝트가 아닌 프로젝트에 쿼리를 실행하려면 프로젝트 ID를 `project_id`.dataset.INFORMATION_SCHEMA.view 형식으로 데이터세트에 추가합니다(예: `myproject`.mydataset.INFORMATION_SCHEMA.VIEWS).
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.VIEWS\u003c/code\u003e view provides metadata about views, with each row representing a single view in a dataset.\u003c/p\u003e\n"],["\u003cp\u003eTo access view metadata, users need specific IAM permissions, including \u003ccode\u003ebigquery.tables.get\u003c/code\u003e and \u003ccode\u003ebigquery.tables.list\u003c/code\u003e, which are included in predefined roles like \u003ccode\u003eroles/bigquery.admin\u003c/code\u003e, \u003ccode\u003eroles/bigquery.dataEditor\u003c/code\u003e, \u003ccode\u003eroles/bigquery.metadataViewer\u003c/code\u003e, and \u003ccode\u003eroles/bigquery.dataViewer\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eQueries against the \u003ccode\u003eINFORMATION_SCHEMA.VIEWS\u003c/code\u003e view must specify either a dataset or a region qualifier, requiring appropriate permissions for either the dataset or the project.\u003c/p\u003e\n"],["\u003cp\u003eThe schema of \u003ccode\u003eINFORMATION_SCHEMA.VIEWS\u003c/code\u003e includes columns such as \u003ccode\u003eTABLE_CATALOG\u003c/code\u003e, \u003ccode\u003eTABLE_SCHEMA\u003c/code\u003e, \u003ccode\u003eTABLE_NAME\u003c/code\u003e, \u003ccode\u003eVIEW_DEFINITION\u003c/code\u003e, and \u003ccode\u003eUSE_STANDARD_SQL\u003c/code\u003e, which detail the project, dataset, view name, view's SQL definition, and the SQL dialect used.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eINFORMATION_SCHEMA\u003c/code\u003e view names are case-sensitive, and when querying, the location of the query execution must match the region of the \u003ccode\u003eINFORMATION_SCHEMA\u003c/code\u003e view.\u003c/p\u003e\n"]]],[],null,["# VIEWS view\n==========\n\nThe `INFORMATION_SCHEMA.VIEWS` view contains metadata about views.\n\nRequired permissions\n--------------------\n\nTo get view metadata, you need the following Identity and Access Management (IAM)\npermissions:\n\n- `bigquery.tables.get`\n- `bigquery.tables.list`\n\nEach of the following predefined IAM roles includes the\npermissions that you need in order to get view metadata:\n\n- `roles/bigquery.admin`\n- `roles/bigquery.dataEditor`\n- `roles/bigquery.metadataViewer`\n- `roles/bigquery.dataViewer`\n\nFor more information about BigQuery permissions, see\n[Access control with IAM](/bigquery/docs/access-control).\n\nSchema\n------\n\nWhen you query the `INFORMATION_SCHEMA.VIEWS` view, the query results contain\none row for each view in a dataset.\n\nThe `INFORMATION_SCHEMA.VIEWS` view has the following schema:\n\nScope and syntax\n----------------\n\nQueries against this view must include a dataset or a region qualifier. For\nqueries with a dataset qualifier, you must have permissions for the dataset.\nFor queries with a region qualifier, you must have permissions for the project.\nFor more\ninformation see [Syntax](/bigquery/docs/information-schema-intro#syntax).\nThe following table explains the region and resource scopes for this view:\n\nReplace the following:\n\n- Optional: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project. If not specified, the default project is used.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: any [dataset region name](/bigquery/docs/locations). For example, ```region-us```.\n- \u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: the ID of your dataset. For more information, see [Dataset qualifier](/bigquery/docs/information-schema-intro#dataset_qualifier).\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n | **Note:** You must use [a region qualifier](/bigquery/docs/information-schema-intro#region_qualifier) to query `INFORMATION_SCHEMA` views. The location of the query execution must match the region of the `INFORMATION_SCHEMA` view.\n\n\u003cbr /\u003e\n\nFor example: \n\n -- Returns metadata for views in a single dataset.\n SELECT * FROM myDataset.INFORMATION_SCHEMA.VIEWS;\n\n -- Returns metadata for all views in a region.\n SELECT * FROM region-us.INFORMATION_SCHEMA.VIEWS;\n\nExamples\n--------\n\n##### Example 1:\n\nThe following example retrieves all columns from the `INFORMATION_SCHEMA.VIEWS`\nview except for `check_option` which is reserved for future use. The metadata\nreturned is for all views in `mydataset` in your default project ---\n`myproject`.\n\nTo run the query against a project other than your default project, add the\nproject ID to the dataset in the following format:\n```````\u003cvar translate=\"no\"\u003eproject_id\u003c/var\u003e````.```\u003cvar translate=\"no\"\u003edataset\u003c/var\u003e```.INFORMATION_SCHEMA.```\u003cvar translate=\"no\"\u003eview\u003c/var\u003e;\nfor example, ```myproject`.mydataset.INFORMATION_SCHEMA.VIEWS``. \n\n```googlesql\nSELECT\n * EXCEPT (check_option)\nFROM\n mydataset.INFORMATION_SCHEMA.VIEWS;\n```\n| **Note:** `INFORMATION_SCHEMA` view names are case-sensitive.\n\nThe result is similar to the following:\n\n\u003cbr /\u003e\n\n```\n +----------------+---------------+---------------+---------------------------------------------------------------------+------------------+\n | table_catalog | table_schema | table_name | view_definition | use_standard_sql |\n +----------------+---------------+---------------+---------------------------------------------------------------------+------------------+\n | myproject | mydataset | myview | SELECT column1, column2 FROM [myproject:mydataset.mytable] LIMIT 10 | NO |\n +----------------+---------------+---------------+---------------------------------------------------------------------+------------------+\n \n```\n\n\u003cbr /\u003e\n\nNote that the results show that this view was created by using a legacy SQL\nquery.\n\n##### Example 2:\n\nThe following example retrieves the SQL query and query syntax used to define\n`myview` in `mydataset` in your default project --- `myproject`.\n\nTo run the query against a project other than your default project, add the\nproject ID to the dataset in the following format:\n```````\u003cvar translate=\"no\"\u003eproject_id\u003c/var\u003e````.```\u003cvar translate=\"no\"\u003edataset\u003c/var\u003e```.INFORMATION_SCHEMA.```\u003cvar translate=\"no\"\u003eview\u003c/var\u003e;\nfor example, ```myproject`.mydataset.INFORMATION_SCHEMA.VIEWS``. \n\n```googlesql\nSELECT\n table_name, view_definition, use_standard_sql\nFROM\n mydataset.INFORMATION_SCHEMA.VIEWS\nWHERE\n table_name = 'myview';\n```\n| **Note:** `INFORMATION_SCHEMA` view names are case-sensitive.\n\nThe result is similar to the following:\n\n\u003cbr /\u003e\n\n +---------------+---------------------------------------------------------------+------------------+\n | table_name | view_definition | use_standard_sql |\n +---------------+---------------------------------------------------------------+------------------+\n | myview | SELECT column1, column2, column3 FROM mydataset.mytable | YES |\n +---------------+---------------------------------------------------------------+------------------+\n \n\u003cbr /\u003e\n\nNote that the results show that this view was created by using a\nGoogleSQL query."]]