1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| # 创建一个数据库 springdb create database springdb character set utf8; # 创建一个表 student create table `student`( `id` int AUTO_INCREMENT NOT NULL, `name` varchar(80) COMMENT '学生姓名', `email` varchar(80) COMMENT '邮箱', `age` int COMMENT '年龄', primary key(`id`) )charset=utf8; # 插入两条数据 insert into student(`id`,`name`,`email`,`age`)values(1,'小','xiaoming@qq.com',3); insert into student(`id`,`name`,`email`,`age`)values(2,'小红','xiaohong@qq.com',23); # 查询结果 mysql> select * from student; +----+------+-----------------+------+ | id | name | email | age | +----+------+-----------------+------+ | 1 | 小 | xiaoming@qq.com | 3 | | 2 | 小红 | xiaohong@qq.com | 23 | +----+------+-----------------+------+
|