NTU-Exam 板


LINE

課程名稱︰資料庫管理 課程性質︰必修 課程教師︰楊立偉 開課學院:管理學院 開課系所︰工商管理學系科技管理組 考試日期(年月日)︰2009.11.11 考試時限(分鐘):120 是否需發放獎勵金:是 (如未明確表示,則不予發放) 試題 : Part I. E-R diagram (20%) 1. List 2 conditions when a relationship should be modeled as an associative entity instead. 2. List the 4 types of cardinality constraints, and draw an example of each. 3. Give an example for each of the following: (a) Derived attribute (b) Multivalued attribute (c) Composite attribute 4. Draw an example for each of the following: (a) Ternary relationship (b) Unary relationship Part II. Relational Database and SQL (20%) 5. Define each of the following terms briefly: (a) Referential integrity (b) Correlated subquery 6. In a relational database, describe 3 types of anomalies that may arise in a table, and give an example of each. 7. Referential integrity is supported in SOL. Explain how the ON UPDATE RESTRICT, ON UPDATE CASCADE, and ON UPDATE SET NULL clauses differ. 8. In SQL, under what conditions can a UNION clause be used? Part III. Exercise 9. According to the following business rules, please draw an E-R diagram, which includes entities, relationships, and cardinalities. ‧ There are schools(學院), students(學生), and clubs(社團). ‧ Every student attends one and only one school; every school has more than one student. ‧ Every student may optionally join one club; every club has more han one student. ‧ Every club belongs to one school; some schools have more than one club, some schools have none. ‧ Any student may work as an assistants(助理) for only one school; every school may have one assistant at most. 10. Transform each of the following E-R diagrams to a relational schema that shows referential integrity constraints, and functional dependencies. If any of the relations are not in 3NF, transform those relations to 3NF.(20%) (a) Fig 3-11a ┌───────┐ │Date_Completed│ └───────┘ | ┌───────┐ | ┌───────┐ │ EMPLOYEE │B | A│ COURSE │ │Employee_ID │╲ | /│Course_ID │ │ ̄ ̄ ̄ ̄ ̄ ̄ ├──────────────────┤ ̄ ̄ ̄ ̄ ̄ │ │Employee_Name │/ Completes \│Course_Title │ │Birth_Date │ │{Topic} │ └───────┘ └───────┘ (b) Fig 3-15b ┌─────────────┐ │ EPLOYEE │ │Employee_ID │ │ ̄ ̄ ̄ ̄ ̄ ̄ │ │Employee_Name │ │{Skill (Skill_Code, │ │Skill_Title, Skill_Type)} │ └─────────────┘ 11. The following relation called GRADE Report for a university. (10%) ┌────────────────────────────────────── │GRADE REPORT ├────────────────────────────────────── │Student_ID Student_Name Campus_Address Major Course_ID Course_Title ├────────────────────────────────────── │168300458 Williams 208 Brooks IS IS 350 Database Mgt │168300458 Williams 208 Brooks IS IS 465 Systems Analysis │543291073 Baker 104 Phillips Acctg IS 350 Database Mgt │543291073 Baker 104 Phillips Acctg Acct 201 Fund Acctg │543291073 Baker 104 Phillips Acctg Mkgt 300 Intro Mktg └────────────────────────────────────── ───────────────────────┐ │ ───────────────────────┤ Instructor_Name Instructor_Location Grade │ ───────────────────────┤ Codd B 104 A │ Parsons B 317 B │ Codd B 104 C │ Miller H 310 B │ Bennett B 212 A │ ───────────────────────┘ (a) Please indicate the functional dependencies in the relation. (b) Decompose the relation into a set of 3NF relations. 12. 某電信公司徵求顧客關係管理人員1位,需熟稔顧客資料操作。顧客資料表格如下,請 以SQL進行以下7個查詢動作。 (20%) 顧客 分店 Customer branch 門號 姓名 生日 居住地區 分店代號 名稱 所在地區 phone_no name birthdate area branch_code name area char(10) char(10) char(8) char(8) char(2) char(10) char(8) 0935000003 張三 20001020 台北 1 台北總店 台北 0935000004 李四 20010120 台北 2 新竹店 新竹 0918000005 王五 20001120 新竹 3 高雄店 高雄 0939000006 陳六 20001220 高雄 異動 資費 action reteplan 異動代號 名稱 資費代號 名稱 單價(秒) action_code name rate_code name unit_price char(2) char(10) char(2) char(10) integer 1 新裝 A 學生族 2 2 變更資費 B 商務人士 1 3 退裝 通話記錄 log_call 發話門號 受話門號 開始日期 開始時間 持續秒數 phone_no1 phone_no2 date time duration char(10) char(10) char(8) char(4) integer 0935000003 0935000004 20091121 0800 60 0935000003 0918000005 20091122 0900 120 0935000003 0939000006 20091122 1000 120 0918000005 0939000006 20091125 1300 180 0935000004 0918000005 20091127 0800 180 0939000006 0932000007 20091129 1400 120 異動記錄 log_action 門號 分店代號 異動代號 資費代號 異動日期 phone_no branch_code action_code rate_code date char(10) char(2) char(2) char(2) char(8) 0935000003 1 1 A 20091005 0935000004 2 1 B 20091015 0918000005 2 1 A 20091025 0939000006 3 1 B 20091105 0935000004 1 2 A 20091115 0939000006 3 3 20091130 (a) 列出住在台北的顧客姓名 (b) 列出門號開頭為0935的顧客姓名 (c) 列出各居住地區的顧客人數,由人數多至少排序 (d) 列出曾發話给2個門號以上的發話門號 (e) 列出所有曾「新裝」為「學生族」資費的門號與異動日期 (f) 列出不是在居住地區「新裝」門號的顧客姓名 (g) 列出曾發話給網外(不是本公司門號)的發話門號 --



※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.247.63







like.gif 您可能會有興趣的文章
icon.png[問題/行為] 貓晚上進房間會不會有憋尿問題
icon.pngRe: [閒聊] 選了錯誤的女孩成為魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一張
icon.png[心得] EMS高領長版毛衣.墨小樓MC1002
icon.png[分享] 丹龍隔熱紙GE55+33+22
icon.png[問題] 清洗洗衣機
icon.png[尋物] 窗台下的空間
icon.png[閒聊] 双極の女神1 木魔爵
icon.png[售車] 新竹 1997 march 1297cc 白色 四門
icon.png[討論] 能從照片感受到攝影者心情嗎
icon.png[狂賀] 賀賀賀賀 賀!島村卯月!總選舉NO.1
icon.png[難過] 羨慕白皮膚的女生
icon.png閱讀文章
icon.png[黑特]
icon.png[問題] SBK S1安裝於安全帽位置
icon.png[分享] 舊woo100絕版開箱!!
icon.pngRe: [無言] 關於小包衛生紙
icon.png[開箱] E5-2683V3 RX480Strix 快睿C1 簡單測試
icon.png[心得] 蒼の海賊龍 地獄 執行者16PT
icon.png[售車] 1999年Virage iO 1.8EXi
icon.png[心得] 挑戰33 LV10 獅子座pt solo
icon.png[閒聊] 手把手教你不被桶之新手主購教學
icon.png[分享] Civic Type R 量產版官方照無預警流出
icon.png[售車] Golf 4 2.0 銀色 自排
icon.png[出售] Graco提籃汽座(有底座)2000元誠可議
icon.png[問題] 請問補牙材質掉了還能再補嗎?(台中半年內
icon.png[問題] 44th 單曲 生寫竟然都給重複的啊啊!
icon.png[心得] 華南紅卡/icash 核卡
icon.png[問題] 拔牙矯正這樣正常嗎
icon.png[贈送] 老莫高業 初業 102年版
icon.png[情報] 三大行動支付 本季掀戰火
icon.png[寶寶] 博客來Amos水蠟筆5/1特價五折
icon.pngRe: [心得] 新鮮人一些面試分享
icon.png[心得] 蒼の海賊龍 地獄 麒麟25PT
icon.pngRe: [閒聊] (君の名は。雷慎入) 君名二創漫畫翻譯
icon.pngRe: [閒聊] OGN中場影片:失蹤人口局 (英文字幕)
icon.png[問題] 台灣大哥大4G訊號差
icon.png[出售] [全國]全新千尋侘草LED燈, 水草

請輸入看板名稱,例如:BabyMother站內搜尋

TOP