4.在一个SSQL Server2000中创建一个医院管理系统中的护士和病人数据表,一个护士可以照看多个病人,而一个病人必须由两个护士共同负责,在下列四个选项中选出正确的答案()
A.create table nurses {nursesid int not null pk_nurses primary key clustered,
name varchar(20)not null,
}
go 
create table patients {patientsid int not null pk_nurses primary key clustered,
name varchar(20) not null,}
go 
create table patientnurses
{patientid not null references patients(patientid),
nurseid not null references patients(nurseid),
constraint pk_patientnurses primary key (pratientid ,nurseid)
}
B. create table nurses {nursesid int not null pk_nurses primary key clustered,
name varchar(20)not null,
}
go 
create table patients {patientsid int not null pk_nurses primary key clustered,
name varchar(20) not null,
nurseid1 not null foreign key (nursesid)reference nurses,
nurseid2 not null foreign key (nursesid)reference nurses,
}
go 
create table patientnurses
{
paitentnurseid  int not null constraint pk_patientnurses clustered,
nursesid int not null,
patientid int not null}
C.
create table nurses {nursesid int not null pk_nurses primary key clustered,
name varchar(20)not null,
}
go 
create table patients {patientsid int not null pk_nurses primary key clustered,
name varchar(20) not null,
nurseid1 not null foreign key (nursesid)reference nurses,
nurseid2 not null foreign key (nursesid)reference nurses
}
D.
create table nurses {nursesid int not null pk_nurses primary key clustered,
name varchar(20)not null,
}
go 
create table patients {patientsid int not null pk_nurses primary key clustered,
name varchar(20) not null,
nurseid1 not null,
nurseid2 not null }该选哪个啊,说下原因好嘛

解决方案 »

  1.   

    选Ccreate table nurses {nursesid int not null pk_nurses primary key clustered, 
    name varchar(20)not null, 

    go 
    create table patients {patientsid int not null pk_nurses primary key clustered, 
    name varchar(20) not null, 
    nurseid1 not null foreign key (nursesid)reference nurses, 关联护士表
    nurseid2 not null foreign key (nursesid)reference nurses  必须有两个护士看护