1.在window系统安装MySQL
2. 创建一个数据库`db_classes`
3. 创建一行表`db_hero`
4. 将四大名著中的常见人物插入这个英雄表
目录
过程如下:
第一步:创建数据库
第二部:建表:
第三步:插入数据
第四步:结果:
1.在window系统安装MySQL
http://t.csdnimg.cn/yXUfS
过程如下:
第一步:创建数据库
mysql> create database db_classes-> default charset = utf8mb4;
第二部:建表:
mysql> use db_classes;
Database changed
mysql> show tables;
Empty set (0.00 sec)mysql> create table db_hero(-> id int not null,-> name varchar(100) not null,-> nickname varchar(100),-> age int,-> gender varchar(2),-> address varchar(100),-> weapon varchar(100),-> world varchar(100),-> types varchar(100)-> );
Query OK, 0 rows affected (0.01 sec)
第三步:插入数据
mysql> insert into db_hero values(1,"孙悟空","齐天大圣",800,"男","花果山","如意金箍棒","西游记","妖族");
Query OK, 1 row affected (0.01 sec)mysql> insert into db_hero values(2,"蜘蛛侠","皮特",20,"男","美国","蛛丝","复仇者联盟","变种人");
Query OK, 1 row affected (0.00 sec)mysql> insert into db_hero values(3,"李逵","黑旋风",30,"男","沂州","两柄板斧","水浒传","人类");
Query OK, 1 row affected (0.01 sec)mysql> insert into db_hero values(4,"赵云","常山赵子龙",27,"男","常山","涯角枪","三国演义","人类");
Query OK, 1 row affected (0.01 sec)mysql> insert into db_hero values(5,"唐僧","金蝉子",25,"男","东土大唐","法杖","西游记","人类");
Query OK, 1 row affected (0.00 sec)mysql> insert into db_hero values(6,"紫霞仙子","盘丝大仙",500,"女","盘丝洞","紫青宝剑","西游计","神仙");
Query OK, 1 row affected (0.00 sec)
第四步:结果:
`