sql语句t_user和t_admin

--create database mydata;
--use mydata;
drop table t_user;
create table t_user(
	username nvarchar(10) not null default N'username',	unique(username),
	userpass nvarchar(10) not null default N'userpass',
	a1 bit not null default 0,
	a2 bit not null default 0,
	a3 bit not null default 0,
	a4 bit not null default 0,
	b1 bit not null default 0, 
	b2 bit not null default 0,
	b3 bit not null default 0,
	b4 bit not null default 0,
	c1 bit not null default 0,
	c2 bit not null default 0,
	c3 bit not null default 0,
	c4 bit not null default 0,
	d1 bit not null default 0,
	d2 bit not null default 0,
	d3 bit not null default 0,
	d4 bit not null default 0,
	usersmalldatetime smalldatetime not null default getdate(),
	p_userid uniqueidentifier not null default newid(),	primary key(p_userid)
);
insert into t_user (username, userpass) values (N'user', N'user');
insert into t_user (username, userpass) values (N'张三', N'zs123');
insert into t_user (username, userpass) values (N'李四', N'ls456');
insert into t_user (username) values (N'王五');
insert into t_user (userpass) values (N'666');

--预处理登陆select count(*) from t_user where username = @username and userpass = @userpass
select * from t_user order by username asc
drop table t_root;
create table t_root(
	rootname nvarchar(10) not null default N'rootname',	unique(rootname),
	rootpass nvarchar(10) not null default N'rootpass',
	rootsmalldatetime smalldatetime not null default getdate(),
	p_rootid uniqueidentifier not null default newid(),	primary key(p_rootid)
);
insert into t_root (rootname, rootpass) values (N'root', N'root');
insert into t_root (rootname, rootpass) values (N'admin', N'admin');
insert into t_root (rootname) values (N'aaaaaa');
insert into t_root (rootpass) values (N'passwd');
select * from t_root order by rootname asc
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值