【正文】
2.(1)R S (2)Rwv S B D B C D b 2 2 6 b 2 6 b 2 d a a d a b 2 7 c a d 2 6 a d d a a d 7 c 5 8 2 6 5 8 d a 5 8 7 c五、查詢設(shè)計題(每小題3分,共24分)(1)Πsname,sdept(δprov=‘北京’(S))(2)Πame,grade(δsdept=‘英語系’(SC wv Cwv S))(3)Πsno (δtname=‘luo’(C wv SC))(4)select sno,sname,provfrom Swhere sex=’男’ and sdept=’計算機系’(5)select sno,sname,sdept from s where prov in(select prov from swhere sname=’zhang’)(6)create view IOT_S(sno,sname,sex,prov)as select sno,sname,sex,provfrom Swhere sdept=’物聯(lián)網(wǎng)系’(7)select sno,snamefrom swhere sno in(select sno from scwhere o in(select ofrom cwhere ame=’C語言’))(8)select sno,avg(grade)from scgroup by snoorder by 2 desc, 1 六、數(shù)據(jù)庫設(shè)計題(每小題10分,共20分)1.(1)借書人出版社出版m圖書借閱nm1郵編地址位置電話單位出版社名借書證號姓名借書日期還書日期數(shù)量書號書名(2)對應的關(guān)系模型如下:借書人(借書證號,姓名,單位) 圖書