select a table from a database in sql code example
Example 1: get all columns from table sql
SELECT
TABLE_NAME
FROM
INFORMATION_SCHEMA.TABLES
Example 2: sql select
Everything in brackets is optional.
SELECT [all/distinct] <COL1>, <COL2>, <COL3>
FROM <TABLE_NAME>
[JOIN <JOIN_CONDITION>]
[WHERE <CONDITION>]
[GROUP BY <COLUMN_NAME>]
[HAVING <SEARCH_CONDITION>]
[ORDER BY <SORT_SPECIFICATION>]
Example 3: select database in sql
USE DatabaseName;