简单的数据库增删改查

Sqlserver语句的增删改查

语法:insert into 表名(列名1,列名2,列名3,列名4) values (数据1,数据2,数据3,数据4)
insert into stuinfo(sid,sname,saddress,sclass,ssex) values (1,‘码仙1’,‘火星’,1001,‘男’);--------这是插入语句

语法:select * from 表名 where 查询条件
select * from stuinfo where sid=2-----查询语句

语法: select * from 表名
select * from stuinfo-------查询表单

语法: update 表名 set 列名=新数据 where 查询条件

update stuinfo set saddress=‘木星’ where sid=1------------修改语句

语法: delete from 表名where 查询条件;
delete from stuinfo where sid=2; --------删除语句

你可能感兴趣的:(JAVA,mysql)