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

Home
MySQL Tutorial
1.Introduction
2.Select Query
3.Database
4.Table
5.Table Join
6.Subquery
7.Insert Update Delete
8.Logic Operator
9.View
10.Data Types
11.Procedure Function
12.Cursor
13.Trigger
14.Date Time Functions
15.Comparison Functions Operators
16.Aggregate Functions
17.Cast Functions Operators
18.Control Flow Functions
19.Encryption Compression Functions
20.Information Functions
21.Math Numeric Functions
22.Miscellaneous Functions
23.String Functions
24.Regular Expressions
25.Data Dictionary
26.MySQL Utilities
27.Privilege
MySQL Tutorial » MySQL Utilities » SHOW 
26.10.4.SHOW CREATE TABLE statement.
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, rows affected (0.02 sec)

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

mysql>
mysql> drop table Employee;
Query OK, 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.
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.