嘿,所有,在此先感謝閱讀!如何使用此數據庫模式獲得免費的實驗室會話?
問題是嘗試找到一個教師免費的時間,一個實驗室是免費的,並且在一個班級註冊的學生是免費的。只有一名教練,大約6個實驗室,平均20名學生。
實驗室,教師和學生已經到了他們忙碌/被佔領的時候。 時間分爲1.5小時,從8-930,930-1100到330-500。 週一至週五有5天需要考慮。 如果沒有適合所有學生,教師和實驗室的單個模塊,那麼課程可以分成多個階段。
這就是我作爲一個數據庫和輸入/輸出想着:
數據庫:
Table : Lab
Fields : l_id, l_name, l_capacity, BM893, BM9311, BM11123, BM1232, BM233, BM335, BT893, BT9311, BT11123, BT1232, BT233, BT335, BW893, BW9311, BW11123, BW1232, BW233, BW335, BTH893, BTH9311, BTH11123, BTH1232, BTH233, BTH335, BF893, BF9311, BF11123, BF1232, BF233, BF335
(each field representing a block to time for a day… e.g. BM893 is Block Monday 8 – 930, all fields are integers where 0 is free and 1 is occupied/busy)
Table: Student
Fields :s_id, s_name, BM893, BM9311, BM11123, BM1232, BM233, BM335, BT893, BT9311, BT11123, BT1232, BT233, BT335, BW893, BW9311, BW11123, BW1232, BW233, BW335, BTH893, BTH9311, BTH11123, BTH1232, BTH233, BTH335, BF893, BF9311, BF11123, BF1232, BF233, BF335
(each field representing a block to time for a day… e.g. BM893 is Block Monday 8 – 930, all fields are integers where 0 is free and 1 is occupied/busy)
Table: Instructor
Fields : i_id, i_name, BM893, BM9311, BM11123, BM1232, BM233, BM335, BT893, BT9311, BT11123, BT1232, BT233, BT335, BW893, BW9311, BW11123, BW1232, BW233, BW335, BTH893, BTH9311, BTH11123, BTH1232, BTH233, BTH335, BF893, BF9311, BF11123, BF1232, BF233, BF335
(each field representing a block to time for a day… e.g. BM893 is Block Monday 8 – 930, all fields are integers where 0 is free and 1 is occupied/busy)
輸入:
1 instructor (i_id)
All labs
N students (s_id, s_id…etc)
輸出:
時間阻止會話(如果超過 一節也比每一節 學生的s_id)
有人可以幫我算一下嗎?
非常感謝你
這是功課嗎? – Davidann 2011-03-23 15:30:30
我刪除了算法標籤。這看起來更像是一個數據庫設計/查詢問題。 – 2011-03-23 16:26:22
其我的BS畢業項目,查詢?我知道我們幾乎是在尋找空閒時間,但是當我們將問題分成若干部分時,您是否認爲需要一種算法來考慮如何分配學生的排列?並且在哪裏實驗室對自由空間的容量不夠是不夠的 – Ahmad 2011-03-23 21:57:29