SHOW
SHOW is an SQL statement used to fetch information about databases, tables, columns, or the status of a server. It is typically used for database monitoring and debugging. Depending on its usage context, it can retrieve differing types of metadata.
Example
Output
Explanation
The SHOW TABLES
statement lists all the tables in the current database. The output displays the tables ‘Customers’, ‘Orders’, and ‘Products’ under the ‘Tables_in_Shop’ heading, indicating these are the tables present in the ‘Shop’ database.
Example
Output
Explanation
The SHOW
command in PostgreSQL is used to display current runtime parameters. In the example code, SHOW timezone;
is used to display the current time zone setting. The output indicates that the current time zone setting is ‘UTC’.
Example
Output
Explanation
The SHOW command in SQL Server is used to return information about the statistics of a table. In the above example, SHOW STATISTICS
returns the statistical information about the SalesOrderDetail
table from the Sales
schema in the AdventureWorks2012
database. This command is helpful to understand distribution of data in table columns which can help in query performance tuning.