• 沒有找到結果。

Final EXAM. 01/12/2015 (100 mins) 1.

N/A
N/A
Protected

Academic year: 2022

Share "Final EXAM. 01/12/2015 (100 mins) 1."

Copied!
3
0
0

加載中.... (立即查看全文)

全文

(1)

Final EXAM. 01/12/2015 (100 mins) 1. (20%) Database System

a) Given the three relations X, Y, and Z below

X: A B Y: C D Z: E F

7 s t 4 2 w

3 z r 2 3 q

1 u

a.1) What values would be retrieved by executing the following statement?

Temp  JOIN X and Y where X.A > Y.D

Temp1  JOIN Temp and Z where Temp.A = Z.E Result  PROJECT B, C, and F from Temp1 Ans: z,r,q

a.2) Translate the above query into a SQL statement.

Ans: SELECT X.B, Y.C, Z.F FROM X, Y, Z

WHERE X.A > Y.D AND X.A = Z.E

b) Describe a scenario in which computing the total deposits in a bank while also transferring $100 from account X to account Y would result in a final sum that is $100 too great. Then describe a scenario in which the final sum turns out to be $100 too small.

Ans: The first occurs if, when computing the total, one checks account X before the funds are withdrawn and account Y after the funds are deposited. The second occurs if account Y is checked before the funds are deposited and X is checked after the funds are withdrawn.

c) Describe the wound-wait protocol.

Ans: Young transactions must release data items they are using when the items are needed by older transactions. The young transactions are then rolled back

2. (20%) Transition Process in Programming Language

a) Show that the grammar below is ambiguous by drawing two distinct parse trees for the string “drip drip drip.”

(2)

ANS: Possible answers include:

b) Is the collections of statements R, (T OR R), (P OR Q), (Q OR T), and (R OR P) consistent? Explain your answer.

No, it is empty

3. (10%) Hash & Data Integrity

a) Suppose you were going to construct a hash file with 26 to 30 buckets using the division hash function discussed in the text. How many buckets should you actually use?

Ans: 29

b) List and explain 2 different schemes, which within a DBMS are used to maintain database integrity.

Ans: (1) the commit/rollback protocol (2) locking

4. (10%) Search and Complexity

(a) At most, how many entries in a list of 5000 names will be interrogated when using the binary search algorithm?

Ans: log 5000 = 13

(b) At most, how many entries in a list of 5000 names will be interrogated when using the sequential search algorithm?

Ans: 5000

(3)

5. (25%) Network

5.1) Where would be the most likely place to put a firewall to provide each of the following services?

(a) Protect an entire domain from attacks from the cloud.

Ans: At the gateway

(b) Protect an entire domain from spam Ans: At the domain’s mail server

(c) Protect an individual machine from worms and viruses Individual machine Ans: At the individual machine

5.2) What are some distinctions between UDP and TCP?

ANS: UDP is a connectionless protocol whereas TCP establishes a two way

communication between the origin and destination of a message. TCP is a reliable protocol in that the origin and destination work together to confirm that the entire message was successfully transferred. In contrast, UDP merely transmits the message without confirming it reception.

5.3) What is the primary difference between using Telnet and SSH to connect to a remote server?

ANS: The SSH protocol encrypts communication to prevent network eavesdroppers from intercepting passwords or other sensitive information.

6. (10%) Call the function CodeWrite (defined below) with the value 101 and record the values that are printed.

def CodeWrite(N) if (N>0) print(N)

CodeWrite(N/2) print(N+2)

ANS: 101 50 25 12 6 3 1 2 3 5 8 14 27 52 103

7. (10%) What is the difference between congestion control and flow control?

ANS: Flow control, meaning that a TCP transport layer at a message’s origin can reduce the rate at which it transmits segments to keep from overwhelming its counterpart at the destination.

Congestion control, meaning that a TCP transport layer at a message’s origin can adjust its transmission rate to alleviate congestion between it and the message’s destination.

參考文獻

相關文件

The cost of shipping one unit of product from origin i to destination j is c ij and you are asked to minimize the

In our Fudoki myth, the third, sociological, “code” predominates (= the jealous wife/greedy mistress), while the first, alimentary, code is alluded to (= fish, entrails), and

To see that this is true without using calculus, note that G = 0 is the equation of a sphere centered at the origin and F = 0 is the equation of a right circular cone with vertex at

Let P be a point on the line segment that join B to the origin.. Find the position of P that minimizes the sum of distances between P and the three vertices of the

(18%) Determine whether the given series converges or diverges... For what values of x does the series

This work is a contribution to the comprehension on the impact of biodiesel blends of different origin and properties on the unregulated emissions of carbonyl compounds, PAH,

2.8 The principles for short-term change are building on the strengths of teachers and schools to develop incremental change, and enhancing interactive collaboration to

3.16 Career-oriented studies provide courses alongside other school subjects and learning experiences in the senior secondary curriculum. They have been included in the