步骤分析: 1.创建表 2.插入数据 3.修改表数据
1.首先登陆MySQL
mysql -uroot -p
密码:XXXXXX
2.查看所有数据库
SHOW DATABASES;
3.我们创建一个测试使用的数据库,我们取名abc,并指定字符集为GBK
CREATE DATABASE IF NOT EXISTS test01 CHARACTER SET GBK;
4.使用当前数据库
USE 数据库名称
5.创建表(我们取名叫Test)传入列和列的类型
CREATE TABLE Test(
id INT,
NAME VARCHAR(20),
sex VARCHAR(10),
birthday DATE,
salary FLOAT,
RESUME TEXT
);
6.插入标记录
INSERT INTO TEST VALUES(1,"zhangsan","male","1980-11-25",2000,"good body");
INSERT INTO TEST VALUES(2,"lisi","male","1980-04-25",1000,"good body");
INSERT INTO TEST VALUES(3,"xiaohong","female","1978-11-25",4000,"good girl");
7.修改表记录数据
UPDATE TEST SET salary=salary+1000 WHERE id=3;