.Net_02_增删改查的基本语法 (Sql 语句)
--增加数据
insert into 表名(列名) values(值);
1 insert into 2 dbo.Student 3 (stuName,stuGender, stuAge) 4 values 5 ('老胡','m','1');
--删除数据
delete 表名 where 条件;
或者
delete from 表名 where 条件;
1 delete dbo.Student where id=1;
--修改数据
update 表名 set 列名=值 where 条件;
1 update dbo.Student set stuName ='凤姐' where id=1
--查询数据
select 列名 from 表名 where 条件 group by 列名 order by 列名
select stuName from dbo.Student where id=1; select stuAge from dbo.Student where 1=1 group by stuAge; select id,stuName from dbo.Student where 1=1 order by id asc; select id,stuName,stuAge from dbo.Student where 1=1 order by id asc group by stuAge