How to create new table in SQL and set custom UTF-8 collation ?

How can I create a new table with custom UTF-8 collation, using SQL ? Is it possible or are there default server settings applied when creating a new table ?
0
give a positive ratinggive a negative rating
28 Feb 2023 at 06:58 PM
Hi,

You can set charset and collation when creating a new table, using SQL. You have to add Default charset and Collation to your SQL query:

CREATE TABLE users (
user_id INT(10) NOT NULL auto_increment,
user_name VARCHAR(30) NOT NULL,
user_surname VARCHAR(30) NOT NULL,
user_email VARCHAR(100) NOT NULL,
user_registration_date DATETIME NOT NULL,
user_status VARCHAR(1) ) DEFAULT CHARSET utf8, COLLATE utf8_general_ci;

0
give a positive ratinggive a negative rating
05 Mar 2023 at 11:53 AM
Tim
Share on FacebookShare on TwitterShare on LinkedInSend email
x
x
2024 AnswerTabsTermsContact us