查询
--切换成student数据库
use student
--查询语句 (注意查看当前数据库是否是要查询的数据库)
select * from stuInfo
插入数据
--单行插入
insert into stuInfo(stuId,stuName) values(1001,'aaa')
insert into stuInfo(stuId,stuName,stuAddr) values(1002,'bbb','河南')
--不指定字段需要按照顺序依次插入
insert into stuInfo values(1003,'ccc','女',20,'河北')
insert into stuInfo values(1004,'ddd',default,20,'山东')
--多行插入
insert into stuInfo (stuId,stuName)
select 1015,'小钱' union
select 1016,'小王' union
select 1017,'小王2' union
select 1018,'小王3'
insert into stuInfo
select 1021,'赵三','男',23,'河北' union
select 1022,'张三','女',20,'广东' union
select 1023,'王五','男',23,'河北'
select * from stuInfo
更新数据
update stuInfo set stuName='修改1',stuAge=31 where stuId=