mysql> use day02
Database changed
mysql> create table daytype1(
-> id int,
-> op_date timestamp
-> )
-> caracter set utf8
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'caracter set utf8' at line 5
mysql> create table daytype(
-> id int,
-> op_date timestamp
-> )
-> character set utf8
-> collate utf8_general_ci;
Query OK, 0 rows affected (0.24 sec)
mysql> insert into daytype
-> values
-> (1);
ERROR 1136 (21S01): Column count doesn't match value count at row 1
mysql> insert into daytype(id)
-> values
-> (1);
Query OK, 1 row affected (0.08 sec)
mysql> select * from daytype;
+------+---------------------+
| id | op_date |
+------+---------------------+
| 1 | 2014-02-19 21:33:06 |
+------+---------------------+
1 row in set (0.00 sec)
mysql> create table daytype1(
-> id int,
-> name varchar(10),
-> gender char(2),
-> likes enum('basketball','football','sleep')
-> )
-> character set utf8
-> collate utf8_general_ci;
Query OK, 0 rows affected (0.14 sec)
mysql> insert into daytype01
-> values
-> (1,'jack','m','basketball');
ERROR 1146 (42S02): Table 'day02.daytype01' doesn't exist
mysql> insert into daytype1
-> values
-> (1,'jack','f','basketball');
Query OK, 1 row affected (0.08 sec)
mysql> insert into daytype1
-> value
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2
mysql> insert into daytype1
-> values
-> (2,'cai','m','fimle');
ERROR 1265 (01000): Data truncated for column 'likes' at row 1
mysql> create table datatype1
-> id int default 1,
-> name varchar(10) default 'a',
-> gender char(2) default 'm',
-> birthday date
-> )
-> character set utf8
-> collate utf8_general_ci;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'id int default 1,
name varchar(10) default 'a',
gender char(2) default 'm',
birt' at line 2
mysql> create table datatype1
-> id int default 1,
-> name varchar(10) default 'a',
-> gender char(2) default 'm',
-> birthday timestamp
-> )
-> character set utf8
-> collate utf8_general_ci;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'id int default 1,
name varchar(10) default 'a',
gender char(2) default 'm',
birt' at line 2
mysql> create table datatype1
-> (
-> id int 1,
->
-> ;l
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1,' at line 3
-> create table datatype1(
-> id int default 1,
-> name varchar(20) default 'cai',
-> gender char(2) default 'f'
-> )
-> character set utf8
-> collate utf8_general_ci;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'l
create table datatype1(
id int default 1,
name varchar(20) default 'cai',
gend' at line 1
mysql> show tables;
+-----------------+
| Tables_in_day02 |
+-----------------+
| daytype |
| daytype1 |
+-----------------+
2 rows in set (0.00 sec)