MySQL Questions and Answers – Character Set Support

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

Answer: d
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

Answer: a
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

Answer: d
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.
advertisement
advertisement

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

Answer: a
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?

Note: Join free Sanfoundry classes at Telegram or Youtube
	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

Answer: a
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’.
advertisement

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

Answer: c
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

Answer: b
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.
advertisement

8. Prior to MySQL 6.0, utf8 was ___________
a) 3 bytes
b) 4 bytes
c) 8 bytes
d) 9 bytes
View Answer

Answer: a
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

Answer: b
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

Answer: c
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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.