See the following szenario:
mysql> use tt2; mysql> show create database tt2; +----------+--------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------+ | tt2 | CREATE DATABASE `tt2` /*!40100 DEFAULT CHARACTER SET utf8 */ | +----------+--------------------------------------------------------------+ 1 row in set (0.00 sec) mysql> create table testi (bla varchar(10)); Query OK, 0 rows affected (0.06 sec) mysql> alter database tt2 charset latin1; Query OK, 1 row affected (0.00 sec)
Which is now the default characterset of table testi
?
a) latin1 b) utf8 c) sjis
[ Databases (5%) - Database Properties | Altering Databases | Obtaining Database Metadata ]
Answer:
b
The default charset of the db was
utf8
at the time the table was created.Default charsets and collations can be defined for a mysql instance, db and table.
The charset/collation can also be set by column.