单表查询: select * from select sname from stu; 条件查询 select sname from stu where sid=2; select sname from stu where sid>2; select sname from stu where sid!=2; 查询时取别名, select sid as 学号,sname as 姓名 from stu; 模糊查询, select * from stu where sname like '小%'; %…
mysql> create table tb_2( -> id int, -> name varchar(10) not null -> ); 插入数据 insert into tb_2 value(1,'xiaobai'); 在非空时,NOT NULL 必须有值, 2,在已有的表中设置一个字段的非空约束 mysql> alter table tb_2 -> modify id int not null; 取消非空约束 mysql> alter table t…