show table columns
-- MySQL
DESCRIBE tableName;
SHOW COLUMNS FROM tableName;
-- SQLite3
.schema tableName
show table columns
-- MySQL
DESCRIBE tableName;
SHOW COLUMNS FROM tableName;
-- SQLite3
.schema tableName
show columns
Copied mysql> SHOW COLUMNS FROM City;
+------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+----------+------+-----+---------+----------------+
| Id | int(11) | NO | PRI | NULL | auto_increment |
| Name | char(35) | NO | | | |
| Country | char(3) | NO | UNI | | |
| District | char(20) | YES | MUL | | |
| Population | int(11) | NO | | 0 | |
+------------+----------+------+-----+---------+----------------+
5 rows in set (0.00 sec)
SHOW COLUMNS Statement
SHOW [EXTENDED] [FULL] {COLUMNS | FIELDS}
{FROM | IN} tbl_name
[{FROM | IN} db_name]
[LIKE 'pattern' | WHERE expr]
sql show columns in table
DESCRIBE table1;
-- result:
+----------------------+---------------------------+------+-----+-------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------------------+------+-----+-------------------+
| film_id | smallint(5) unsigned | NO | | 0 | |
| title | varchar(128) | NO | | NULL | |
| description | text | YES | | NULL | |
| release_year | year(4) | YES | | NULL | |
| language_id | tinyint(3) unsigned | NO | | NULL | |
| original_language_id | tinyint(3) unsigned | YES | | NULL | |
| rental_duration | tinyint(3) unsigned | NO | | 3 | |
| rental_rate | decimal(4,2) | NO | | 4.99 |
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us