数据库期末考试复习试题与答?- 百度文库

塢ۺ⣨15֣

ijҽԺϵͳУĸʵֱͣΪ ңƵַƵ绰 ţַ

ҽ֤ţְƣ ˣţԱ ҴԼ

һжҽһֻһңһҽ

ֻһң

һҽɸ˵Σһ˵ҽֻһ һסˣһֻסһ ע⣺ͬҿͬIJš ƣ

1ҽԺϵͳERͼ5֣ 2E-RͼתΪϵģͣ5֣

Ҫ1:11:nϵкϲ

3ָתÿϵģʽ롣5֣

IJοֱ׼

һѡ⣨ÿ1.5֣

1A 2C 3D 4B 5C 6D 7B 8B 9D 10C 11C 12B 13D 14D 15B 16B 17B 18C 19C 20A

⣨ÿ1֣

1. ݿϵͳ 2. Լ 3. CLUSTER INDEX 4. IN 6. ۼ 7. 8. 9. 10. ϵͳ

5.

⣨ÿ5֣

1ο𰸣

ǡ=ΪֵӡǴӹϵRSĹ

ѿѡȡABֵȵЩԪ飬ֵΪRS={trts| trRtsStr[A]=ts[B]}

A=B

ȻһĵֵӣҪϵнбȽϵķͬ飬ڽаظȥ

2ο𰸣

ͼǴһ򼸸ıͬһ

ݿֻͼĶ壬ͼӦݣЩݴԭĻУеݷ仯ͼвѯҲ֮ı䡣ͼһͿһѯɾҲһͼ֮ٶµͼǶͼĸ²ơ

3ο𰸣

ĸԣACIDԣ 1ԭԣавҪôҪô

2һԣʹݿһһ״̬䵽һһ״

̬

3ԣһڲIJʹõݶԲǸ

ġ

4ԣһύݿĸıõġ

ġ

ο𰸣

1Jno(J)- Jno (?City='' (S)

SPJ

?Color='' (P))

2Pno,Jno(SPJ)¦Pno (?Sno='S1' (SPJ)) 3RANGE P PX

GET W (SPJ.Sno): SPJ.Jno='J1'?PX(SPJ.Pno=PX.PnoPX..Color='')) 4CREATE TABLE S (Sno CHAR(6) PRIMARY KEY, Sname CHAR(10), Status INT, City CHAR(20));

5SELECT Pname,TotalQty FROM (SELECT Pno,SUM(Qty) TotalQty FROM SPJ

WHERE Jno='J1' GROUP BY Pno) X,P WHERE P.Pno=X.Pno;

6SELECT Jno FROM J WHERE Jno NOT IN (SELECT Jno FROM SPJ WHERE

Sno IN (SELECT Sno FROM S WHERE City='')); SELECT Jno FROM J WHERE NOT EXISTS (SELECT * FROM SPJ,S WHERE

SPJ.Sno=S.Sno AND SPJ.Jno=J.Jno AND City='');

SELECT Jno FROM J WHERE NOT EXISTS (SELECT * FROM SPJ WHERE

SPJ.Jno=J.Jno AND EXISTS (SELECT * FROM S WHERE S.Sno=SPJ.Sno AND City=''));

7UPDATE P SET Color='' WHERE Color=''; 8INSERT INTO SPJ VALUES'S2','P4','J6',400 ֱ׼

ڣ1256ÿ3֣ÿ2֣дǷȷ淶鴦ȷдṹһֲ֣©ддڿ۷֣ṹȷһɲ֡

2ο𰸣

1ϵSTUDENT1NFΪFдڷ SNAME,SDEPT,MNAMEԺѡ루S#,CNAMEIJֺ 2ֺS#,CNAMESNAME,SDEPT,MNAME

ϵֽΪ

R1(S#,SNAME,SDEPT,MNAME)

F1 = { S#SNAME,SDEPT,MNAME}

R2(S#,CNAME,GRADE)F2={S#,CNAMEGRADE}

ڹϵR1дڷԶԺѡĴݺS#SDEPTԽR1һֽ⣺

R11(S#,SNAME,SDEPT) F11 = { S#SNAME,SDEPT} R12(SDEPT,MNAME) F12 = { SDEPTMNAME}

R2,R11,R12ϵģʽкǷƽģҾؾǺѡ룬ϵģʽBCNF

ֱ׼

1شR1NFȷ˵3֣ûȷشɿ1֡ 2ηֽ3֣ÿõϵģʽ1.5֣ȷشʲ

ô͵ĺȷ˵õϵģʽBCNF1֡

塢ۺ

ο𰸣

1E-Rͼͼʾ

Ƶַ Ƶ绰 ַ 1 n 1 ס n 1 n ֤ Ա 1 ӵ n ҽ ְ ijҽԺϵͳĻE-Rͼ

ϵͷ779662525#qq.com(#滻Ϊ@)