- 创建数据库
create database `Mushroom`
character set `utf8`
collate `utf8_general_ci`;
2.使用数据库
use Mushroom;
- 创建Student表
CREATE TABLE `Student` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(16) NOT NULL,
`gender` int(11) DEFAULT NULL,
`age` int(11) DEFAULT NULL,
`address` varchar(128) DEFAULT NULL,
PRIMARY KEY (`id`)
)engine=InnoDB default charset=UTF8;
- 插入数据
insert into Student values(1,'冯强',1,21,'中国成都');
insert into Student values(2,'廖周涛',2,20,'中国攀枝花');
insert into Student values(3,'周杰伦',1,45,'中国台湾');
insert into Student values(4,'陈奕迅',1,50,'中国香港');
insert into Student values(5,'蔡依林',2,44,'中国台湾');
insert into Student values(6,'薛之谦',1,35,'中国重庆');
insert into Student values(7,'鹿晗',1,28,'中国北京');
insert into Student values(8,'关晓彤',2,21,'中国成都');
insert into Student values(9,'吴亦凡',1,27,'加拿大');
insert into Student values(10,'冯洋洋',1,12,'中国深圳');
insert into Student values(11,'林俊杰',1,36,'新加坡');
insert into Student values(12,'黄晓明',1,39,'中国青岛');
insert into Student values(13,'迪丽热巴',2,27,'中国新建');
insert into Student values(14,'小甜甜',2,18,'中国微信');
源码下载
关注下方的微信公众号,回复:java_div_page.code
欢迎加入交流群:451826376