This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Character Set Support”.
1. What is the maximum collations a character set can have?
a) 0
b) 1
c) 2
d) more than 1
View Answer
Explanation: The MySQL server allows simultaneous use of multiple character sets. A given character set is allowed to have one or more collations. It can be chosen according to the need of the database.
2. Unicode support is provided in MySQL.
a) True
b) False
View Answer
Explanation: In MySQL, Unicode character set support is provided by the utf8 and ucs2 character sets. There are further additional character sets available as of MySQL version 6.0.4.
3. Which clause can be used to sort string values according to a specific collation?
a) SORT
b) GROUP
c) FILTER
d) COLLATE
View Answer
Explanation: The ‘COLLATE’ operator can be used to sort the string values according to a specific collation. For example, ‘SELECT col FROM tbl ORDER BY col COLLATE latin1_swedish_ci’ sorts by swedish collation.
4. Which MySQL statement is used to find out which character sets are available?
a) SHOW CHARACTER SET
b) SHOW COLLATION
c) SHOW CHARACTER SETS
d) SHOW COLLATIONS
View Answer
Explanation: It is simple to determine the character sets and collations that are available in MySQL. ‘SHOW CHARACTER SET’ shows the character sets while ‘SHOW COLLATION’ shows the collations.
5. Which collations does this MySQL statement list?
SHOW COLLATION LIKE 'utf8%'
a) names beginning with utf8
b) names ending with utf8
c) names containing utf8% anywhere
d) names ending in utf8%
View Answer
Explanation: The character set ‘utf8’ is used for the Unicode character set 8. The ‘LIKE’ keyword does the job of narrowing the search space to refer to only those names that begin with ‘utf8’.
6. Which statement is used to show the server’s current character set and collation settings?
a) SHOW CONSTANTS
b) SHOW CONSTRAINTS
c) SHOW VARIABLES
d) DISP VARIABLES
View Answer
Explanation: The statement ‘SHOW VARIABLES LIKE ‘character\_set\_%” displays a table consisting of two columns, ‘Variable_name’ and ‘Value’. Replacing characer\_set\_% with collation\_% shows the collation variables.
7. What does UTF stand for int utf8?
a) Universal Transformation Format
b) Unicode Transformation Format
c) Universal Transformation Formula
d) Unicode Transformation Formula
View Answer
Explanation: In the utf8 character set in MySQL, the characters are represented in one, two or three bytes. ‘UTF’ stands for ‘Unicode Transformation Format’. Unicode support prior to MySQL 6.0 was different.
8. Prior to MySQL 6.0, utf8 was ___________
a) 3 bytes
b) 4 bytes
c) 8 bytes
d) 9 bytes
View Answer
Explanation: ‘UTF’ stands for ‘Unicode Transformation Format’. Unicode support prior to MySQL 6.0 was different from that post MySQL 6.0. The older utf8 was of three bytes.
9. Post MySQL 6.0, utf8 was ___________
a) 3 bytes
b) 4 bytes
c) 5 bytes
d) 6 bytes
View Answer
Explanation: Unicode support prior to MySQL 6.0 was different from that post MySQL 6.0. The older utf8 was of three bytes. The newer utf8 is now of four bytes. This is applicable to MySQL 6.0 and above.
10. What is generally used as a synonym for CHARACTER SET?
a) CSET
b) CHSET
c) CHARSET
d) CHCSET
View Answer
Explanation: ‘CHARACTER SET’ can be abbreviated into ‘CHARSET’ and can be used in the same contexts and statements where ‘CHARACTER SET’ is used. ‘charset’ is the server-supported character set.
Sanfoundry Global Education & Learning Series – MySQL Database.
To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Check Information Technology Books
- Apply for Programming Internship
- Practice Programming MCQs
- Check MySQL Books