CREATE TABLE 功能 (
id int IDENTITY (1, 1),
功能名称 nvarchar (50),
parentid int
)
GO
CREATE TABLE 用户 (
id int IDENTITY (1, 1) NOT NULL,
用户名 nvarchar (50),
密码 nvarchar (50),
修改日期 datetime,
起始日期 datetime
)
GO
CREATE TABLE 权限 (
id int IDENTITY (1, 1) NOT NULL,
用户ID int,
功能id int,
操作权限,
)
GO
--数据
--软件的功能分类
insert into 功能
select '产品销售',0
union all select '电器',1
union all select '食品类',1
union all select '日常用品',1
union all select '家电',2
union all select '电脑',2
--用户
insert into 用户
select '张三',null,getdate(),getdate()
union all select '李四',null,getdate(),getdate()