① 数据库建一张表,成绩表,姓名,学号,语文分,数学分,英语分,总成绩 ,造十条数据
create table score(
id int(12) PRIMARY key auto_increment,
student_num varchar(12) not null,
student_name varchar(50) not null,
chinese_score int(3) DEFAULT 0,
math_score int(3) DEFAULT 0,
english_score int(3) DEFAULT 0,
sum_score int(3) DEFAULT 0
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into score(student_num,student_name,chinese_score,math_score,english_score,sum_score)values('000001','小明',90,98,98,chinese_score+math_score+english_score);
insert into score(student_num,student_name,chinese_score,math_score,english_score,sum_score)values('000002','小二',91,98,98,chinese_score+math_score+english_score);
insert into score(student_num,student_name,chinese_score,math_score,english_score,sum_score)values('000003','小兰',94,98,95,chinese_score+math_score+english_score);
insert into score(student_num,student_name,chinese_score,math_score,english_score,sum_score)values('000004','小十',90,98,96,chinese_score+math_score+english_score);
insert into score(student_num,student_name,chinese_score,math_score,english_score,sum_score)values('000005','小白',92,98,99,chinese_score+math_score+english_score);
insert into score(student_num,student_name,chinese_score,math_score,english_score,sum_score)values('000006','小绿',90,96,94,chinese_score+math_score+english_score);
insert into score(student_num,student_name,chinese_score,math_score,english_score,sum_score)values('000007','小蓝',95,98,98,chinese_score+math_score+english_score);
insert into score(student_num,student_name,chinese_score,math_score,english_score,sum_score)values('000008','小青',91,91,98,chinese_score+math_score+english_score);
insert into score(student_num,student_name,chinese_score,math_score,english_score,sum_score)values('000009','小红',94,92,95,chinese_score+math_score+english_score);
insert into score(student_num,student_name,chinese_score,math_score,english_score,sum_score)values('000010','小橙',99,100,100,chinese_score+math_score+english_score);