MySQL表的增删改查
1.新增(Create)
1.1单行 + 全列
INSERT INTO students
VALUES ('1', '张三', '18');
1.2单行 +指定列
INSERT INTO students ( sid,age)
VALUES (2,20);
1.3批量 + 全列
INSERT INTO students VALUES
(3,"李四",22),
(4,"王麻子",21),
(5,"赵四",23);
2.查询(Retrieve)
2.1全列查询
SELECT * FROM students;
2.2指定列查询
SELECT name FROM students;
2.3去掉重复的数值
SELECT DISTINCT age FROM students;
2.4为查询列表指定别名
SELECT 1 + 1 AS 结果;