Information schema

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In relational databases, the information schema (information_schema) is an ANSI-standard set of read-only views which provide information about all of the tables, views, columns, and procedures in a database.[1] It can be used as a source of the information which some databases make available through non-standard commands, such as:

 => SELECT count(table_name) FROM information_schema.tables;
 (1 row)
 => SELECT column_name, data_type, column_default, is_nullable
       FROM information_schema.columns WHERE table_name='alpha';
  column_name | data_type | column_default | is_nullable 
  foo         | integer   |                | YES
  bar         | character |                | YES
 (2 rows)
 => SELECT * FROM information_schema.information_schema_catalog_name;
 (1 row)


As a notable exception among major database systems, Oracle does not as of 2015 implement the information schema. An open-source project exists to address this.

RDBMSs which support information_schema include:

  • Microsoft SQL Server
  • MySQL
  • PostgreSQL
  • InterSystems Caché

RDBMSs which do not support information_schema include:

  • Oracle Database
  • IBM DB2
  • SQLite

See also[edit]

External links[edit]


  1. ^ Melton, Jim; Simon, Alan R. (1993). "19.2 Metadata, Repositories and The INFORMATION_SCHEMA". Understanding the New SQL: A Complete Guide. The Morgan Kaufmann series in data management systems, ISSN 1046-1698. Morgan Kaufmann. p. 371. ISBN 9781558602458. Retrieved 2015-10-22. Metadata that applies primarily to the runtime database environment is managed through the INFORMATION_SCHEMA. [...] Metadata that applies to the information system environment as a whole is managed through the dictionary or repository.