Administration

SQL Inspect tables and schemas

Inspect schema metadata; these commands are client-specific rather than portable SQL.

Availability: Common SQL with references for SQL standard, MySQL/MariaDB, PostgreSQL, SQL Server, SQLite and Oracle Database; syntax and feature support vary by engine and version.中文

Syntax

Use the database client's schema inspection command or query its information schema/catalog.

Examples

Example (standard-style syntax). Verify supported keywords in your database.

-- PostgreSQL / standard information schema
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';

SQLite-oriented variant; dialect behaviour may differ.

-- SQLite
.tables
.schema users

Parameters, options and clauses

Option / clauseDescription
EXPLAINShow the optimizer's planned execution strategy.
ANALYZESome engines execute the statement and report actual statistics; this can run the query.
FORMATChoose plan output format where supported.
Catalog / information schemaInspect objects and definitions through system metadata.
Dialect / versionCheck the linked database manual for vendor-specific behaviour.

Dialect references

Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory