Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 50 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
50
Dung lượng
5,14 MB
Nội dung
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... (1)introduces the declaration \\.it11 the keywords CREATE TRIGGER and the name of the trigger Line (2) then gives the triggering event, namely the update of the networth attribute of the MovieExec relation Lines (3)through (3) set up a way for the condition and action portions of this trigger to talk about both the old tuple (the tuple before the update) and the new tuple (the tuple after the update) These... that year and cheek through them for the giren title If: as is often the case, the key for the multiattribute index is really the concatenation of the attributes in some order, then we can even use this index to find all the tuples with a given value in the first of thethe attributes Thus Part of the design of a multiattribute index is the choice of the order in ~vhich the attributes are listed For... update to the networth column of Line (2) of Fig 7.8 says that the action of the rule is executed after the triggering event, as indicated by the keyword AFTER We may replace AFTER by BEFORE, in which case the W E condition is tested before the HN triggering event, that is, before the modification that awakened the trigger has been made to thedatabase If the condition is true, then the action of the trigger... preventing the event that awakened it, a trigger tests a condition If the condition does not hold, then nothing else associated with the trigger happens in response to this event 3 If the condition of the trigger is satisfied, the action associated with the trigger is performed by the DBMS The action may then prevent the event from taking place, or it could undo the event (e.g., delete the tuple inserted)... either Q1 or Q2 I*on-ever insertion I requires index blocks as n-ell as a data block, for a total of that we read and write t~vo 6 disk accesses That observation explains the last column in Fig 6.17 The final roTv in Fig 6.17 gives the average cost of an action, on the assumption that the fraction of the time \ye do Q1 is pl and the fraction of the time we do Q yis p p : therefore, the fraction of the. .. meets the SQL uptlatability conditions, since the view asks only for sorne components of some tuples of one base table: 6-73 Renaming Attributes Solnetinles, we might prefer t o give a viexv's attributes names of our own choosing, rather than use the names that come out of the query defining the view may specify the attributes of the view by listing them, surrounded by parentheses, after the name of the. .. Dellorgan's laws": the negation of the AND of terms is the OR of the negations of the same terms Thus, in Example 7.10 the first condition mas that the star is male, and we used gender = 'FJ as a suitable negation (although perhaps gender 'MI ~vouldbe the more normal way to phrase the negation) The second condition is that the name begins with 'Ms ', and for this negation we used the NOT LIKE comparison... principle the condition can be anything that could follow WHERE in a n SQL query This condition may refer to the attribute being constrained, by using the name of that attribute in its expression However, if the condition refers to any other relations or attributes of relations then the relation must be introduced in the F O clause of a subquery (even if RM the relation referred to is the one to which the. .. presC# value that is not the certificate of any movie executive, then the insertion is rejected If we attempt to update the presC# component of a Studio tuple, and the new value is not the cert# of a movie executive, the update is rejected 5) 6) However, if we change the MovieExec relation, say by deleting the tuple for the president of a studio, this change is invisible to the above CHECK constraint... p2 CHAPTER 6 THEDATABASE LANGUAGE SQL 300 Depending on pl and pz, any of the four choices of indexlno index can yield the best average cost for the three actions For example, if pl = pz = 0.1 then the expression 2 8p1 f 8p2 is the smallest, so we would prefer not to create any indexes That is, if we are doing mostly insertion, and very few queries, then we don't want an index On the other hand, if