|
2014/3/24 下午 06:38:20
請問這兩題要怎麼解?
1. 考慮一個公司的行事曆系統,該系統需記載公司裡員工的行事曆和會議的安排等相關事項。具體來說,該Entity-Relationship Diagram 包括以下數個實體型態:
部門(Department):包括部門編號(dId)、部門名稱(dName) 和部門所在(dLocations)、其中部門編號和部門名稱均唯一,但部門所在地可有多個。
員工(Employee):包括工號(eId)、姓名(name)、性別(gender)、電子郵件(email) 和學歷(education)。其中工號是唯一,而學歷可有多個,且應包括學位(degree)、畢業學校(school) 和畢業日期(date)。此外,每個員工必須隸屬於一個部門。
約會(Appointment):記載員工在行事曆上的約會,包括開始日期時間(startDateTime)、時間長度(duration)、主旨(subject) 和地點(location)。其中沒有任何一個屬性是唯一,不過每一位員工的各個約會其開始日期時間必不同。
會議(Meeting):包括會議名稱(name)、開始日期時間(startDateTime)、預定時間長度(duration)、主旨(subject) 和議程(agenda)。其中會議名稱是唯一。此外,主席(chair)、參與者(participants) 和聯絡人(contact) 都必須記載。這些人都是員工,且聯絡人的分機號碼(extension) 必須記載。而每一會議必須配備一個會議室。
會議室(Room):包括會議室編號(rNo)、容納人數(size) 和位置(location)。此外,每一會議室有一控管部門。
請繪出符合以上資料需求的ER Diagram。必要時可自行假設其他相關狀況,但要寫清楚。
2. We want to store information about books. Each book has a title, a price, and an ISBN number. The ISBN number uniquely identifies the book.
Some books are children’s books. Each children’s book also specifies the minimum age and the maximum age, which together indicate the ideal age range for its readers.
Some books are educational books. Each educational book also specifies the grade, that is, the school grade that the book is most suited for.
Each educational book may also be associated with one or multiple exercise CDs. Each CD has a name and a length (in minutes). We can only uniquely identify each CD using its name and the information of the book that the CD is associated with.
Each book is written by one or many authors. Each author has an author ID, a name, and multiple addresses.
Each book is also published by exactly one publisher. Each publisher has a name and a single address. When a publisher publishes a book, we want to record the publishing year and the quantity
Q1:Draw an ER diagram for this application. Decide the key attributes and identify those. Q2:Convert the above ER diagram into a relational schema. Specify the primary key of each relation in your schema.
|
|
|
|
|
|
|
|
|
|
|
板主 : 徵求中
Top 10 評價排行 |
 |
資料庫設計與應用 |
|
|
|
|
|
|
|
|
|
資料庫設計與應用 |
 |
|
|
專家等級 |
評價 |
|
|
一代宗師 |
10000 |
|
|
曠世奇才 |
5000 |
|
|
頂尖高手 |
3000 |
|
|
卓越專家 |
1500 |
|
|
優秀好手 |
750 |
|
|
|
|
|
|
|