The INFORMATION_SCHEMA or equivalent system catalogs for introspection.

A standard SQL schema providing read-only access to database metadata: tables, columns, constraints, privileges. Portable across databases (with variations). Preferred over querying system catalog tables directly for application portability.

Compatibility

Show:
Database System Support Status Since Version Notes
MySQL ✓ Supported 5.0 MySQL has supported INFORMATION_SCHEMA since 5.0.
PostgreSQL ✓ Supported 9.1 PostgreSQL uses system catalogs like pg_tables and information_schema for metadata.
SQL Server ✓ Supported 2000 SQL Server has supported INFORMATION_SCHEMA since SQL Server 2000, alongside sys.tables and other catalog views.
Oracle ✓ Supported 12c Oracle uses system catalogs like ALL_TABLES for metadata introspection.
SQLite ✗ Not Supported SQLite exposes metadata via the sqlite_master table and PRAGMA interfaces rather than a standard INFORMATION_SCHEMA.

Details

Understanding the available tables and columns in a database is crucial for building tools that rely on metadata.

Standard Syntax

Version Support

MySQL: Since 5.0 PostgreSQL: Since 9.1 SQL Server: Since 2000 Oracle: Since 12c SQLite: Not supported

Per-Database Syntax & Notes

SQLite

SQLite exposes metadata via the sqlite_master table and PRAGMA interfaces rather than a standard INFORMATION_SCHEMA.

SELECT * FROM sqlite_master; PRAGMA table_info(table_name);