Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4991

Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4993
Question 15: Which is finally the default character set of table testi? – MySQL Question of the Day

Skip to content

By urs in mysql questions

 
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 ]
 

Tags: , ,

Comment Feed

One Response


  1. 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.

You must be logged in to post a comment.