drop table if exists t1, t2, t3;
create table t1 (c1 tinyint primary key) COMMENT = 'engine "innodb"';
insert into t1 values(1);
select * from t1;
c1
1
drop table t1;
create table t1 (c1 smallint primary key) COMMENT = 'engine "innodb"';
insert into t1 values(1);
select * from t1;
c1
1
drop table t1;
create table t1 (c1 mediumint primary key) COMMENT = 'engine "innodb"';
insert into t1 values(1);
select * from t1;
c1
1
drop table t1;
create table t1 (c1 int primary key) COMMENT = 'engine "innodb"';
insert into t1 values(1);
select * from t1;
c1
1
drop table t1;
create table t1 (c1 bigint primary key) COMMENT = 'engine "innodb"';
insert into t1 values(1);
select * from t1;
c1
1
drop table t1;
create table t1 (c1 float primary key) COMMENT = 'engine "innodb"';
insert into t1 values(0.5);
select * from t1;
c1
0.5
drop table t1;
create table t1 (c1 double primary key) COMMENT = 'engine "innodb"';
insert into t1 values(0.5);
select * from t1;
c1
0.5
drop table t1;
create table t1 (c1 date primary key) COMMENT = 'engine "innodb"';
insert into t1 values("2010/03/26");
select * from t1;
c1
2010-03-26
drop table t1;
create table t1 (c1 time primary key) COMMENT = 'engine "innodb"';
insert into t1 values("11:22:33");
select * from t1;
c1
11:22:33
drop table t1;
create table t1 (c1 year primary key) COMMENT = 'engine "innodb"';
insert into t1 values("2010");
select * from t1;
c1
2010
drop table t1;
create table t1 (c1 datetime primary key) COMMENT = 'engine "innodb"';
insert into t1 values("2010/03/26 11:22:33");
select * from t1;
c1
2010-03-26 11:22:33
drop table t1;
create table t1 (c1 int primary key, c2 int) COMMENT = 'engine "innodb"';
insert into t1 values(1,100);
select * from t1;
c1	c2
1	100
insert into t1 values(1,200);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
select * from t1;
c1	c2
1	100
drop table t1;
