Reputation: 3914
CREATE TABLE `table1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(128) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`)
)
-
CREATE TABLE `table2` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
`email` varchar(128) DEFAULT NULL UNIQUE,
)
Questions:
show create table tbl_name
displays UNIQUE KEY email_2 (email)
or some other _num
. Why? What does tlb_name_num
mean and what is it used for?show create table tbnm
always displays sql in table1 form, even if table is created by table2 sql syntax. Why? UNIQUE KEY (email)
also works. but it's transformed to UNIQUE KEY email (email)
on show create table
. Why does it work, why is it transformed, etc?Upvotes: 0
Views: 32
Reputation: 800
Upvotes: 1