1-- MySQL
2SELECT *
3FROM INFORMATION_SCHEMA.COLUMNS;
4
5-- SQL Server (possible solution)
6SELECT *
7FROM SYS.COLUMNS;
8
9-- Oracle
10SELECT *
11FROM ALL_TAB_COLS; -- (If you only want user-defined columns)
12-- ALL_TAB_COLS : only user-defined columns
13-- ALL_TAB_COLUMNS : both user-defined AND system columns
1DESCRIBE table1;
2
3-- result:
4+----------------------+---------------------------+------+-----+-------------------+
5| Field | Type | Null | Key | Default | Extra |
6+----------------------+---------------------------+------+-----+-------------------+
7| film_id | smallint(5) unsigned | NO | | 0 | |
8| title | varchar(128) | NO | | NULL | |
9| description | text | YES | | NULL | |
10| release_year | year(4) | YES | | NULL | |
11| language_id | tinyint(3) unsigned | NO | | NULL | |
12| original_language_id | tinyint(3) unsigned | YES | | NULL | |
13| rental_duration | tinyint(3) unsigned | NO | | 3 | |
14| rental_rate | decimal(4,2) | NO | | 4.99 |