Database Theory: What is Character Set and Collation

In this post, I discuss a small Database theory topic for Character Set and Collation.
As we are Database Professional and already experience with “Collate” in SQL Server and MySQL.
I have found that fresher and intermediate Database Professional have doubt and question about Character Set and Collation.

Let me clear this with easy note.

What is Character Set?

A Character Set is nothing but just a list of symbols and encodings.

For example, latin1 and UTF-8 are most popular character set.
Using latin1, you will be able to write all American words because latin1 contains all ASCII characters, which are sufficient to write any English word. On the contrary, with ASCII you will not be able to write all words of Western European specific languages, because for instance, characters like ‘ë’, ‘õ’, ‘Ñ’ are missing.

A Character Set encodes characters so that they fit in a memory. For example, the euro symbol, €, will be encoded as 0xa4, and in UTF-8, it will be 0xe282ac.

What is Collation?

A collation is a set of rules for comparing characters in a character set. It has also ruled for sorting of characters and proper order of two characters varies from language to language.
A Collation compared two strings like, if a word is greater than another one, and sort accordingly.

If you are using “latin1” Character set, you can use “latin1_swedish_ci” Collation.
You have to choose right collation because wrong collation may affect your database performance.

Now create one database in MySQL using Character Set and Collation:

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from

Leave a Reply

3 Comments on "Database Theory: What is Character Set and Collation"

Notify of

Sort by:   newest | oldest | most voted
Marcia Cerullo
Marcia Cerullo
11 months 1 day ago

Nice theory thanks !

10 months 9 days ago

This is the right site for everyone who wishes to understand this topic. You realize so much its almost tough to argue with you (not that I really would want toHaHa). You certainly put a fresh spin on a subject that’s been written about for a long time. Wonderful stuff, just great!|

8 months 10 days ago

well-favored than you may be now. You’re so intelligent.