一
二
答案
三
答案
答案 1---5、CBDCA
6---10、CBCAA
2) 3
4) Revoke
1) View Level
3) (100,98)
5) Transaction
1) Answer
Only values occurring in the primary key attribute of the referenced
relation may occur in the foreign key attribute of the referencing
relation
2) Answer
A candidate key is a set of attributes in a table that satisfies: (1) No
two distinct records have the same values for it. (2) There is not a
proper subset of a candidate key that satisfies (1).
A superkey is a set of attributes where no two distinct records have
the same values for it.
3) Answer
Should be divided.
Loan_numbeamount, and loan_number is not superkey in the
combined relation.
4) Answer
ACID Stands for atomicity, consistency, isolation, durability.
Atomicity: Either all operations of the transaction are properly
reflected in the database or none are. Consistency: Execution of a
transaction in isolation preserves the consistency of the database.
Isolation: Although multiple transactions may execute concurrently,
each transaction must be unaware of other concurrently executing
transactions. Durability: After a transaction completes successfully,
the changes it has made to the database persist, even if there are
system failures.
四
答案
1)Answer:
B
6
2
4
7
2)Answer:
A
a1
a4
a2
a3
C
7
3
5
9
B
6
4
6
7
200
200
200
200
200
C
7
5
7
9
C
7
3
3
7
3)Answer:
A
a1
a2
a1
a2
4) Answer
A
a1
a2
a3
a4
B
6
2
2
6
B
8
8
7
4
1)
2)
3)
4)
5)
五
答案
char(30),
Answer
Create table Class(
cname char(30),
meets at char(30),
room char(30),
fid
primary key(cname),
foreign key(fid) references faculty)
Answer
Insert into students
Values(‘111’,’Kobe Bryant’,’CS’,’senior’,22);
Insert into Enrolled
Values(‘111’,’CS411’)
Answer
Delete from class
Where class.fid in
(select fid from faculty where fname=’Joe Smith’)
Answer
Create view busyfaculty as
(select fid, fname
From faculty natural join class
Group by fid, fname
Having count(cname)>3)
Answer
(select class.snum from student natural
join class natural
join
enrolled where room=’R128’) union
(select snum form students natural join enrolled where cname in
(select cname from class natual join entrolled group by cname having
count(snum)>=5)
a) Answer:
六
答案
七
答案
b) Answer:
Member(MID,Name, Birthdate)
Fee(Date, Description, PID, MID)
Board (MID)
Organizer(MID, CellPhone)
Tour(TID,Name)
Travel(TravelID, TID, MID, Cost, Startdate, Enddate
FeeforTravel(PID, TravelID)
Orgnize(MID,TID)
Participate(MID, TravelID)
a) Answer:
Candidate key: AB, BD
b) D in ABCD.
c) Not in 3NF.Fc={ABC,AD,DAE,EF}.
Rcan be decomposed into {A,B,C},{A,D,E},{E,F}