MySQL基础语法1
1、创建数据库名:school
create database school;
2、查看所有数据库
Show databases;
3、创建学生表:students,包含(学生id,学生姓名name,学生性别sex,学生年龄age,学生入学时间create_time, 身高height,体重weight,班级名class)
create table students(id int comment “学生id”,
stu_name varchar(10) comment “学生姓名”,
sex varchar(1) comment “学生性别”,
age int comment “学生年龄”,
create_time date comment “入学时间”,
height float comment “身高”,
weight float comment “体重”,
class varchar(10) comment “班级名”
);
4、在题3的学生表中插入一条数据:
例如:1, zhangsan, 18,‘女’,2019-10-5,172.4,100.3,测试开发一班
2, zhangsan, 19,‘男’,2019-10-5,179.4,150.3,测试开发二班
insert into students(id,stu_name,age,sex,create_time,height,weight,class)
values(“1”,“zhangsan”,“18”,“女”,“2019-10-05”,“172.4”,“100.3”,“测试开发一班”),
(“2”,“zhangsan”,