这个题有人会做吗
有 若干个教室,每个教室若干座位.现在有若干个单位来这个学校考试,要求每个单位尽量在一个教室安排,实在安排不下的可以放在相邻的教室.总的座位绝对够,要求写出每个单位在每个教室的人员数量分配表表结构和示例数据如下:
create table jiaoshi (jid int identity(1,1),jrenshu int)
create table danwei(did int identity(1,1),dname varchar(10),drenshu int)
insert into jiaoshi values(30)
insert into jiaoshi values(10)
insert into jiaoshi values(20)
insert into jiaoshi values(30)
insert into jiaoshi values(10)
insert into jiaoshi values(10)
insert into jiaoshi values(30)
insert into jiaoshi values(20)
insert into jiaoshi values(10)
insert into jiaoshi values(20)
insert into jiaoshi values(15)
insert into jiaoshi values(20)
insert into jiaoshi values(10)
insert into jiaoshi values(30)
insert into danwei values('1001',34)
insert into danwei values('1002',14)
insert into danwei values('1003',23)
insert into danwei values('1004',13)
insert into danwei values('1005',7)
insert into danwei values('1006',27)
insert into danwei values('1007',18)
insert into danwei values('1008',12)
insert into danwei values('1009',22)
insert into danwei values('1010',33)