创建表的操作
CREATE TABLE student(
id INT,
NAME VARCHAR(20),
chinese FLOAT,
english FLOAT,
math FLOAT
);
用创建的表
USE student;
插入数据
INSERT INTO student(id,NAME,chinese,english,math) VALUES(1,’张小明’,89,78,90);
INSERT INTO student(id,NAME,chinese,english,math) VALUES(2,’李进’,67,53,95);
INSERT INTO student(id,NAME,chinese,english,math) VALUES(3,’王五’,87,78,77);
INSERT INTO student(id,NAME,chinese,english,math) VALUES(4,’李一’,88,98,92);
INSERT INTO student(id,NAME,chinese,english,math) VALUES(5,’李来财’,82,84,67);
INSERT INTO student(id,NAME,chinese,english,math) VALUES(6,’张进宝’,55,85,45);
INSERT INTO student(id,NAME,chinese,english,math) VALUES(7,’黄蓉’,75,65,30);
1.查询表中所有学生的信息
SELECT * FROM student;
2.查询表中所有学生的姓名和对应的英语成绩
SELECT NAME,english FROM student;