标签:null int comm birt atime select hda utf8 修改表
说明:student是要创建的表名
主键:primary key
注释:comment
1,创建表:
create table student(
sno varchar(20) not null primary key comment ‘学号‘,
sname varchar(20) not null comment ‘学生姓名‘,
ssex varchar(20) not null comment ‘性别‘,
sbirthday datatime comment ‘出生年月‘
)charset=utf8 collate=utf8_general_ci;
2,添加表信息:
insert into student values
(108,‘曾华‘,‘男‘,‘1977-09-01‘,95033),
(105,‘匡明‘,‘男‘,‘1975-10-02‘,95031),
(107,‘王丽‘,‘女‘,‘1976-01-23‘,95033),
(101,‘李军‘,‘男‘,‘1976-02-20‘,95033),
(109,‘王芳‘,‘女‘,‘1975-02-10‘,95031),
(103,‘陆君‘,‘男‘,‘1974-06-03‘, 95031);
3,删除整个表
drop table student;
4,查看表所有内容
select * from student;
5,查看表某个字段内容 son或sname或ssex或sbirthday
select sno from student;
6,查看多个字段内容
select sno,sname from student;
7,修改表内容
update student set sno=‘200‘ where sno=‘101‘;
标签:null int comm birt atime select hda utf8 修改表
原文地址:https://www.cnblogs.com/wfc139/p/8901682.html