SHOW
Example
Section titled “Example”SHOW TABLES;Output
Section titled “Output”+-----------------+| Tables_in_Shop |+-----------------+| Customers || Orders || Products |+-----------------+Explanation
Section titled “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
Section titled “Example”SHOW timezone;Output
Section titled “Output” TimeZone------------ UTC(1 row)Explanation
Section titled “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
Section titled “Example”USE AdventureWorks2012;GOSHOW STATISTICS Sales.SalesOrderDetail;Output
Section titled “Output”Name Updated Rows Rows Sampled Steps--------------------------------------------- -------------------- -------------------- -------------------- ----_pkc_SalesOrderDetailID Aug 13 2021 3:54AM 121315 121315 200
...Explanation
Section titled “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.