show table contents mysql code example
Example 1: mysql show data from table
mysql> SELECT * FROM [table name];
Example 2: mysql show table structure
DESCRIBE table_name;
Example 3: print all records of table in mysql
SELECT * FROM TABLE_NAME;
OR
SELECT column_name_1, column_name_2 FROM TABLE_NAME;
Example 4: mysql command show tables
SHOW TABLES;
Example 5: show table info mysql
Copied mysql> DESCRIBE pet;
+
| Field | Type | Null | Key | Default | Extra |
+
| name | varchar(20) | YES | | NULL | |
| owner | varchar(20) | YES | | NULL | |
| species | varchar(20) | YES | | NULL | |
| sex | char(1) | YES | | NULL | |
| birth | date | YES | | NULL | |
| death | date | YES | | NULL | |
+
Example 6: mysql command show tables
mysql -u user -p