Share on Google+Share on Google+

MySQL Attribute

Advertisement
This example illustrates how to use the COLLATE attribute in MySQL.

MySQL Attribute

This example illustrates how to use the COLLATE attribute in MySQL.

In this example we use the COLLATE attribute to define the attribute of the table. In the query below character data types (CHAR, VARCHAR, TEXT) can include CHARACTER SET and COLLATE attributes to specify the character set and collation for the column.

Query

CREATE TABLE atttribute (attribute_name CHAR(20) CHARACTER SET utf8 COLLATE utf8_bin);

Query

insert into atttribute (attribute_name) values('collate');

Output

+----------------+
| attribute_name |
+----------------+
| collate        |
+----------------+

Advertisements

Posted on: December 9, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.