which the declaration includes no CHARACTER SET  or a COLLATE  attribute. To override this, provide CHARACTER SET  and COLLATE  explicitly. 

## 10.3.4 Table Character Set and Collation 

Every table has a table character set and a table collation. The CREATE TABLE  and ALTER TABLE statements have optional clauses for specifying the table character set and collation: 

CREATE TABLE tbl_name  ( column_list ) [[DEFAULT] CHARACTER SET charset_name ] [COLLATE collation_name ]] ALTER TABLE tbl_name [[DEFAULT] CHARACTER SET charset_name ] [COLLATE collation_name ] 

Example: 

CREATE TABLE t1 ( ... ) CHARACTER SET latin1 COLLATE latin1_danish_ci; 

MySQL chooses the table character set and collation in the following manner: 

•If both CHARACTER SET charset_name  and COLLATE collation_name  are specified, character set charset_name  and collation collation_name  are used. 

•If CHARACTER SET charset_name  is specified without COLLATE , character set charset_name and its default collation are used. To see the default collation for each character set, use the SHOW CHARACTER SET  statement or query the INFORMATION_SCHEMA CHARACTER_SETS  table. 

•If COLLATE collation_name  is specified without CHARACTER SET , the character set associated with collation_name  and collation collation_name  are used. 

•Otherwise (neither CHARACTER SET  nor COLLATE  is specified), the database character set and collation are used. 

The table character set and collation are used as default values for column definitions if the column character set and collation are not specified in individual column definitions. The table character set and collation are MySQL extensions; there are no such things in standard SQL. 

## 10.3.5 Column Character Set and Collation 

Every “character”  column (that is, a column of type CHAR , VARCHAR , a TEXT  type, or any synonym) has a column character set and a column collation. Column definition syntax for CREATE TABLE  and ALTER TABLE  has optional clauses for specifying the column character set and collation: 

col_name  {CHAR | VARCHAR | TEXT} ( col_length ) [CHARACTER SET charset_name ] [COLLATE collation_name ] 

These clauses can also be used for ENUM  and SET  columns: 

col_name  {ENUM | SET} ( val_list ) [CHARACTER SET charset_name ] [COLLATE collation_name ] 

Examples: 

CREATE TABLE t1 ( col1 VARCHAR(5) 

