Dept_Posi_Psn(部门、职位、人员关系表)DeptID       int          部门ID
PosiID       int          职位ID
PersonID     int          人员ID
PsnStatus    tinyint      是否有效()

解决方案 »

  1.   

    然后再有如
    Departments 部门表
    Persons     人员表
    Positions   职位表
      

  2.   

    建立了一个最基本的多对多关系的表,学生和课程是两个实体,而成绩则是两者的关系。
    --建立测试数据
    create table 学生
    (
    学号 nvarchar(4) not null
        constraint PK__学生__学号 primary key nonclustered,
    姓名 nvarchar(20),
    性别 nvarchar(2)
        constraint DF__学生_性别 default '男'
    )
    --------------------------------------------------------------
    insert into 学生
    select 'S001','CHENG','男'
    union all select 'S002','ZHANG','女'
    union all select 'S003','WANG','女'
    union all select 'S004','FENG','男'create table 课程
    (
    课程编号 nvarchar(4) not null
             constraint PK__课程__课程编号 primary key nonclustered,
    课程名称 nvarchar(20),
    学分 int
    )
    insert into 课程
    select 'T001','物理',3
    union all select 'T002','政治',2
    union all select 'T003','数学',5
    ---------------------------------------------------------------
    create table 成绩
    (
    学号 nvarchar(4) not null,
    课程编号 nvarchar(4) not null,
    成绩 int
    )
    insert into 成绩
    select 'S001','T001',90
    union all select 'S001','T002',50
    union all select 'S001','T003',60
    union all select 'S002','T001',85
    union all select 'S002','T002',60
    union all select 'S002','T003',60
    union all select 'S003','T001',50
    union all select 'S003','T002',59
    union all select 'S003','T003',56
    union all select 'S004','T001',90
    union all select 'S004','T002',98
    union all select 'S004','T003',98