--用户信息注册
insert into UserInfo(name,password,voicequery,question,answer,realname,sex,birthday,countries,certificate,number,telephone,fixed,email,address,postcode,passengers)values('yangyifei','admin','admin','您的工号是?','0086','yangyifei','男','2013-11-18','中国','二代身份证','220104201011101239','18742067526','0411-85469863','
[email protected]','大连市高新园区','160011','成人')
--查询全部用户信息
select * from UserInfo
--判断用户是否存在
select COUNT(1) from UserInfo where name='yangyifei'
--用户登录判断
select id from UserInfo where name='yangyifei' and password='admin'
--根据用户ID进行删除
delete from UserInfo where id=1
--删除全部用户信息
delete from UserInfo
--根据用户ID进行修改注册信息
update UserInfo set name='yangyifei',password='admin',voicequery='admin',question='您的工号是?',answer='0001',realname='yangyifei',sex='男',birthday='1989-11-18',countries='中国',certificate='二代身份证',number='220104201011101239',telephone='18742067526',fixed='0411-85469863',email='
[email protected]',address='大连市高新园区',postcode='160011',passengers='成人' where id=2
--根据用户ID进行密码修改
update UserInfo set password='admin' where id=2
--查看用户密码是否修改成功
select password from UserInfo where id=2
--获取用户信息总数
select COUNT(1) from UserInfo
--获得用户前几条数据
select top 5 name,password from UserInfo
--获得列表用户数据
select realname,sex,certificate,number,telephone,passengers from UserInfo
--根据用户ID获得列表数据
select realname,sex,certificate,number,telephone,passengers from UserInfo where id=2
--根据用户ID查询用户信息
select top 1 realname,sex,certificate,number,telephone,passengers from UserInfo where id=2
--根据用户名查询用户信息
select top 1 realname,sex,certificate,number,telephone,passengers from UserInfo where name='yangyifei'