SHOW CREATE TABLE statement. : SHOW « MySQL Utilities « MySQL Tutorial






mysql>
mysql>
mysql> CREATE TABLE Employee(
    ->     id            int,
    ->     first_name    VARCHAR(15),
    ->     last_name     VARCHAR(15),
    ->     start_date    DATE,
    ->     end_date      DATE,
    ->     salary        FLOAT(8,2),
    ->     city          VARCHAR(10),
    ->     description   VARCHAR(15)
    -> );
Query OK, 0 rows affected (0.02 sec)

mysql>
mysql>
mysql> show create table Employee;
+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table    | Create Table                                                                                                                                                                                                                                                                                                                                                     |
+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Employee | CREATE TABLE `employee` (
  `id` int(11) default NULL,
  `first_name` varchar(15) default NULL,
  `last_name` varchar(15) default NULL,
  `start_date` date default NULL,
  `end_date` date default NULL,
  `salary` float(8,2) default NULL,
  `city` varchar(10) default NULL,
  `description` varchar(15) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>
mysql> drop table Employee;
Query OK, 0 rows affected (0.00 sec)








26.10.SHOW
26.10.1.SHOW COLUMNS and DESCRIBE can display information about the columns in individual INFORMATION_SCHEMA tables.
26.10.2.Use the SHOW statement to find out what databases currently exist on the server:
26.10.3.Display all table names
26.10.4.SHOW CREATE TABLE statement.
26.10.5.SHOW INDEX FROM tbl_name
26.10.6.To see the structure or schema of a database
26.10.7.Show a detailed listing of the columns of your database.