create database student;
use student;
create table student_info(
ID int,
xh varchar(255),
xm varchar(255),
xb varchar(255),
csny varchar(255),
nj int,
xy varchar(255)
);
insert into student_info VALUES (1, 'J171001', '张三丰', '男', '2001年3月', 21, '信息工程');
insert into student_info VALUES (2, 'J171002', '李静', '女', '2001年2月', 21, '工商管理');
insert into student_info VALUES (3, 'J1711003', '张明', '男', '2001年3月', 21, '计算机科学与应用');
insert into student_info VALUES (4, 'J1721001', '王丽', '女', '2002年6月', 22, '轮机工程');
insert into student_info VALUES (5, 'J1721002', '李大成', '男', '2002年9月', 22, '机电工程');
insert into student_info VALUES (6, 'J1721002', '张自云', '女', '2000年4月', 22, '艺术学院');
insert into student_info VALUES (7, 'J1731003', '刘芳芳', '女', '2002年8月', 23, '材料学院');
insert into student_info VALUES (8, 'J1731003', '赵明明', '男', '2001年12月', 23, '智能工程学院');
insert into student_info VALUES (9, 'J1731003', '赵明', '男', '2004年11月', 21, '工程学院');
SELECT * FROM student_info where xy like '计算机科学与应用' ;
SELECT xb,count(*) FROM student_info group by xb;
SELECT * FROM student_info where xh = 'J1721001';