一.常用语句
CREATE DATABASE `test01`
CREATE DATABASE `test02`
DROP DATABASE `test02`;
SHOW DATABASES;
USE `test01`
SHOW TABLES;
CREATE TABLE `student`(
`id` INT auto_increment PRIMARY KEY COMMENT '主键',
`name` VARCHAR(20) NOT NULL COMMENT '名字',
`class` INT NOT NULL COMMENT '班级号'
)ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT '学生列表';
DROP TABLE `student`;
INSERT INTO `student`
(`name`,`class`)
VALUES
("小王",1),
("小李",2),
("小孙",3);
SELECT * FROM `student`;
SELECT `class`,`name` FROM `student`;
SELECT DISTINCT `class`,`name` FROM `student`;
SELECT * FROM `student` WHERE `class`=1