1、创建一个英雄表(hero)
要求:
主键
name
nickname
address
groups
telphone
建表代码:
CREATE TABLE IF NOT EXISTS t_hero (
id int primary key auto_increment,
name varchar(50) not null unique,
nickname varchar(100) unique,
address varchar(100),
`groups` varchar(100),
email varchar(100),
telphone int
);
desc t_hreo; # 显示表结构
insert into t_hero values(null, "孙悟空", "齐天大圣", "花果山水帘洞","西游记", "545454@qq.com",13571894); #插入数据
select * from t_hero; #查看表中数据
查看插入有数据:
多写一点数据: