一、需求
将如下学生成绩EXCEL表数据导入到MySQL数据库中
二、实现
1、在MySQL中建对应的表
create table student_score(
id varchar(10) primary key,
name varchar(20),
chinese_score DECIMAL(10,2),
math_score DECIMAL(10,2),
english_score DECIMAL(10,2),
total_score DECIMAL(10,2),
class_rank INT
);
2、将EXCEL表另存为CSV格式
3、使用DataGrip导入数据
(1)打开DataGrip,连接到MySQL,选中刚创建的学生成绩表(student_score),右键导入数据。
(2)选中刚刚转换的学生成绩表.csv文件
(3)导入数据
4、查看数据是否导入成功
select * from student_score;