① 資料庫建一張表,成績表,姓名,學號,語文分,數學分,英語分,總成績 ,造十條數據
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);