GTS Joe
GTS Joe

Reputation: 4152

Default MySQL Keyword

In this statement:

CREATE TABLE tbl_name (
    id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    content TEXT,
    date_added DATE NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

InnoDB is the storage engine and UTF-8 is the character set.

But what does the DEFAULT keyword represent? What effect does it have in the above statement?

Upvotes: 0

Views: 64

Answers (1)

Barmar
Barmar

Reputation: 780949

It's an optional keyword that goes with CHARSET, which is setting the default character set for all columns that contain character data and don't specify an explicit CHARACTER SET.

It doesn't mean anything by itself, there's no difference between CHARSET and DEFAULT CHARSET.

Upvotes: 3

Related Questions