I'm confused about the MySQL Collations and its Encodings, People usualy uses one of these three collations:
- utf8mb_bin
- utf8mb4_general_ci
- utf8mb4_unicode_520_ci
What I don't understand is when to use each of these collations when needed, Like for example,
A table for names like this
[id - name]
It would only has names characters from different languages like french, german, latin. . .
Do I use for such a table the collation of utf8mb_bin
or stick with utf8mb4_unicode_520_ci
,
In other hand, A table for topics of a blog for example:
[id - title - subject]
Do I put all the columns collation to utf8mb4_unicode_520_ci
or use:
utf8mb_bin
for title
utf8mb4_unicode_520_ci
for subject
Since as I understood, the utf8mb4_unicode_520_ci
has some emotes in it that would be used in blogs subjects, Or do I just ignore everything and just use utf8mb4_unicode_520_ci
on all?
But overall, What is the point of using these different collations? And How does they affect my results in SELECT
queries?
What I would like to know in berif is:
What collation to be used for each of:
- names
- titles
- subjects
- emails
- bios
- messages
- usernames