mysql error1064(42000)错误

mysql> create table employee(
    ->   id int,
    ->   name varchar(40),
    ->   sex varchar(4),
    ->   birthday date,
    ->   entry_date date,
    ->   salary decimal(8,2),
    ->   resum text
    -> );
Query OK, 0 rows affected (0.08 sec)

mysql> insert into employee(id,name,sex,birthday,entry_date,salary,resum)
    -> values(1,'zhangsan','male','1993-03-04','2016-11-10','1000','i am a developer');
Query OK, 1 row affected (0.01 sec)

mysql> insert into employee(id) values(6);
Query OK, 1 row affected (0.00 sec)

mysql> insert into employee(id,name) values(6,'张三');
Query OK, 1 row affected (0.05 sec)

mysql> update employee set salary=5000;
Query OK, 3 rows affected (0.05 sec)
Rows matched: 3  Changed: 3  Warnings: 0

mysql> update employee set salary=3000 where name='zhangsan';
Query OK, 1 row affected (0.05 sec)
Rows matched: 1  Changed: 1  Warnings: 0
mysql> create table emp(
    -> id int,
    -> name varchar(40),
    -> sex varchar(4));
Query OK, 0 rows affected (0.08 sec)

mysql> insert into emp(id,name,sex)
    -> values(1,'zhangsan','male');
Query OK, 1 row affected (0.05 sec)

mysql> insert into emp(id) values(6);
Query OK, 1 row affected (0.05 sec)

mysql> insert into emp(id,name) values(6,'张三');
Query OK, 1 row affected (0.05 sec)

mysql> update employee set id=5000;
Query OK, 4 rows affected (0.05 sec)
Rows matched: 4  Changed: 4  Warnings: 0
mysql> CREATE TABLE star (
    -> star VARCHAR ( 10 ) NOT NULL,
    -> team VARCHAR ( 10 ) NOT NULL,
    -> time INT NOT NULL,
    -> PRIMARY KEY ( star )) ENGINE = INNODB DEFAULT charset = utf8;
Query OK, 0 rows affected, 1 warning (0.08 sec)

mysql> insert into star(star,team,time) values('James','Lakes',35);
insert into star(star,team,time) value('Kobe','Lakes',40);
Query OK, 1 row affected (0.06 sec)
Query OK, 1 row affected (0.00 sec)

mysql> updata star set team = 'smile';
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 'updata star set team = 'smile'' at line 1
mysql> create table smile(
    -> number int,
    -> school varchar(40),
    -> please varchar(40));
Query OK, 0 rows affected (0.08 sec)

mysql> insert into smile(number,school,please)
    -> values(1,'beida','beijing');
Query OK, 1 row affected (0.05 sec)

mysql> insert into smile(number,school,please)
    -> values(2,'qinghua',beijing);
ERROR 1054 (42S22): Unknown column 'beijing' in 'field list'
mysql> insert into smile(number,school,please)
    -> values(1,'qinghua','beijing');
Query OK, 1 row affected (0.05 sec)

mysql> updata smile set number = 3;
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 'updata smile set number = 3' at line 1
mysql> insert into smile(number) values(3);
Query OK, 1 row affected (0.05 sec)

mysql> insert into smile(number,school) values(4,'changqingteng');
Query OK, 1 row affected (0.05 sec)

mysql> updata smile set number=6;
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 'updata smile set number=6' at line 1

你可能感兴趣的:(mysql,数据库,database)