SHOW CREATE TABLE displays the CREATE TABLE statement to create a given table. : COLLATION Character Set « Table « MySQL Tutorial






mysql>
mysql> CREATE TABLE myTable
    -> (
    ->     c1 CHAR(10)
    -> ) DEFAULT CHARACTER SET latin1 COLLATE latin1_danish_ci;
Query OK, 0 rows affected (0.05 sec)

mysql>
mysql> desc myTable;
+-------+----------+------+-----+---------+-------+
| Field | Type     | Null | Key | Default | Extra |
+-------+----------+------+-----+---------+-------+
| c1    | char(10) | YES  |     | NULL    |       |
+-------+----------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql>
mysql> SHOW CREATE TABLE myTable;
+---------+------------------------------------------------------------------------------------------------------------------------------------------------+
| Table   | Create Table                                                                                                                                   |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------+
| myTable | CREATE TABLE `mytable` (
  `c1` char(10) collate latin1_danish_ci default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_danish_ci |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

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

mysql>
mysql>








4.20.COLLATION Character Set
4.20.1.Character Sets and Collations in MySQL
4.20.2.Server Character Set and Collation
4.20.3.Every database has a database character set and a database collation.
4.20.4.List the available character set
4.20.5.TEXT CHARACTER SET latin1 COLLATE latin1_bin
4.20.6.character_set_system
4.20.7.Using alter command to change characgter set
4.20.8.The output from SHOW COLLATION includes all available character sets.
4.20.9.The SHOW CHARACTER SET command shows all available character sets.
4.20.10.Table and Column Definition with character and collate
4.20.11.Database, Table, and Column Definition with Character and collate
4.20.12.SHOW CREATE DATABASE displays the CREATE DATABASE statement that creates a given database:
4.20.13.SHOW CREATE TABLE displays the CREATE TABLE statement to create a given table.
4.20.14.The SHOW COLUMNS statement displays the collations of a table's columns when invoked as SHOW FULL COLUMNS
4.20.15.Table Character Set and Collation
4.20.16.Column Character Set and Collation