Vous êtes sur la page 1sur 23

Unit II 1. What are the aspects of relational model?

? The Three aspects of relational model are: Structural aspect: The data in the database is perceived by the user as tables, and nothing but tables. Integrity aspect: Those tables satisfy certain integrity constraints. Manipulative aspect: The operators available to the user for manipulating those tables- for example, for purposes of data retrieval are operators that derive tables from tables. !oin. 2. Mention the important points about relational databases. " set of important points about relational databases: #elational databases store data in the form of tables $logically%. The ro&s of a table are called as tuples. The columns of a table are 'no&n as attributes. (very attribute has a data type associated &ith it. (very attribute has a domain &hich provides the set of all possible values that can be stored as values for that attribute. Tables are called as relations. The table names are called as relational variable 3. What is a catalog? The catalog contains detailed information, sometimes called descriptor information or Metadata, regarding the various ob!ects that are of interest to the system itself. 4. Define a transaction. " transaction is a logical unit of &or', typically involving several database operations. " transaction begins &hen !"I# $%&#'&($I)# is executed and terminates &hen ()MMI$ or %)** &(+ is executed. f those operators, three particularly important ones are select, pro!ect and

,. What is the use of embedded '-*? " fundamental principle underlying embedded S)*, &hich &e call the dual. mode principle/ is that any S)* statement that can be used interactively can also be embedded in an application program. 0. What is a cursor? " cursor consists essentially of a 'ind of $logical% pointer - a pointer in the application, that is, not one in the database - that can be used to run through a collection of ro&s, pointing to each of the ro&s in turn and thereby providing addressability to those ro&s one at a time. 1. Write short note on )2!#/ 3!$(4 and (*)'! statements. +(,: (-(. S)* +(, / .ursor name01 pens the specified cursor. " set of ro&s is thus identified and becomes the current active set for the cursor. 2(T.3: (-(. S)* 2(T.3 /.ursor name0 I,T /host variable reference commalist01 "dvances the specified cursor to the next ro& in the active set. .* S(: (-(. S)* .* S( /.ursor name01 .loses the specified cursor. The cursor no& has no current active set. 5. Discuss about d6namic '-*. 4ynamic S)* is a part of embedded S)*. It consists of a set of 5dynamic statements6- &hich themselves are compiled ahead of time- &hose purpose is precisely to support the compilation and execution of regular S)* statements that are constructed at run time. 7. What is a pol6morphic operator? "n operator is said to be polymorphic if it is defined in terms of some parameter + and the arguments corresponding to + can be of different types on different invocations.

18. What is a candidate 9e6? *et 7 be a set of attributes of relvar #. Then 7 is a candidate 'ey for # if and only if it has both of the follo&ing properties: 8ni9ueness Irreducibility 11. What is a primar6 9e6? It is possible for a given relvar to have t&o or more candidate 'eys. In such a case, the relational model has historically re9uired that exactly one of those 'eys be chosen as the primary 'ey. 12. What is an alternate 9e6? It is possible for a given relvar to have t&o or more candidate 'eys. In such a case, the relational model has historically re9uired that exactly one of those 'eys be chosen as the primary 'ey and the others are then called alternate 'eys. 13. What is a foreign 9e6? " foreign 'ey is a set of attributes of some relvar #: &hose values are re9uired to match values of some candidate 'ey of some relvar #;. 14. What is a trigger? Triggered procedures are precompiled procedures that are stored along &ith the database and invo'ed automatically &henever some specified event occurs. 1,. What are the relational operators? 8nion, Intersect, 4ifference, +roduct, Select, +ro!ect, <oin, 4ivide are the relational operators. 10. Discuss union/ intersection/ and difference :ith e;ample. 11. Define (artesian product. .artesian product of t&o relations a and b, a TIM(S b, &here a and b have no common attribute names, to be a relation &ith a heading that is the union of the headings of a and b and &ith a body appearing in a and a tuple appearing in b.

15. What is a range <ariable? " range variable is a variable that 5ranges over6 some specified relation. If range variable = ranges over relation r, then, at any given time, the expression 5=6 denotes some tuple of r. 17. Discuss about =uer6.b6.e;ample? )uery->y-(xample syntax, &hich is attractive and intuitively very simple, is based on the idea of ma'ing entries in blan' tables. 28. Define tuple relational calculus. 21. Define domain relational calculus.

22. What do 6ou mean b6 t6pe constraints? " type constraint is, precisely, a definition of the set of values that constitute a given type. 23. What do 6ou mean b6 database constraints? " database constraint is a constraint on the values a given database is permitted to assume. 24. What do 6ou mean b6 relation constraints? " relation constraint is a constraint on the values a given relvar is permitted to assume. 2,. What do 6ou mean b6 attribute constraints? "n attribute constraint is a constraint on the values a given attribute is permitted to assume. 20. What is referential integrit6? #eferential integrity database must not contain any unmatched foreign 'ey values. 21. What is a transition constraint?

" transition constraint is a constraint on the legal transitions that a given variable-in particular, a given relvar or a given database-can ma'e from one value to another. 25. What are the different aspects of securit6 problem? There are many aspects to the security problem. 3ere are some of them: *egal, social, and ethical aspects +hysical controls +olicy 9uestions perational problems

3ard&are controls perational system support

"nd finally Issues that are the specific concern of the database system itself. 27. What is discretionar6 access control? In the case of discretionary control, a given user &ill typically have different access rights on different ob!ects1 further, there are fe& inherent limitations regarding &hich users can have &hich rights on &hich ob!ects. 4iscretionary schemes are thus flexible. 38. What is mandator6 access control? In the case of mandatory control, by contrast, each data ob!ect is labeled &ith a certain classification level, and each user is given a certain clearance level. 31. What are the contents of audit trail record? " typical audit trail record might contain the follo&ing information: #e9uest$source text% Terminal from &hich the operation &as invo'ed 8ser &ho invo'ed the operation 4ate and time of the operation #elvar$s%, tuples$s%,attribute$s% affected >efore images$old values% "fter images$ne& values%

32. What is entit6 integrit6? ,o component of the primary 'ey of any base relvar is allo&ed to accept nulls are called entity integrity. 33. Define a <ie:. 34. What are <ie:s for? There are many reasons &hy vie& support is desirable. 3ere are some of them: =ie&s provide a shorthand or 5macro6 capability. =ie&s allo& the same data to be seen by different users in different &ays at the same time. =ie&s provide automatic security for hidden data. =ie&s can provide logical data independence. 3,. Define the golden rule. ?olden #ule is ,o update operation must ever assign to any relvar a value that causes its relvar predicate to evaluate to 2"*S(. r $a little loosely%: ,o relvar must ever be allo&ed to violate its o&n predicate. 30. Define a distributed database s6stem. " distributed database system consists of a collection of sites, connected together via some 'ind of communications net&or', in &hich: a. (ach site is a full database system site in its o&n right but b. The sites have agreed to &or' together so that a user at any site can access data any&here in the net&or' exactly as if the data &ere all stored at the user@s o&n site. 31. Define a distributed database management s6stem. " ne& soft&are component at each site logically an extension of the local 4>MS provides the necessary partnership functionality, and it is the combination of these ne& components together &ith the existing 4>MSs that constitutes &hat is usually called the distributed database management system.

35. What are the ad<antages of distributed databases? It enables the structure of the database to mirror the structure of the enterpriselocal data can be 'ept locally, &here it most logically belongs-&hile at the same time remote data can be accessed &hen necessary. 37. What is the fundamental principle of distributed database? The fundamental principle of distributed database is To the user, a distributed system should loo' exactly li'e a nondistributed system. 48. What are the ob>ecti<es of distributed databases? The ob!ectives of distributed databases are ;% *ocal autonomy :% ,o reliance on a central site A% .ontinuous operation B% *ocation independence C% 2ragmentation independence D% #eplication independence E% 4istributed 9uery processing F% 4istributed transaction management G% 3ard&are independence ;H% perating system independence ;;% ,et&or' independence ;:% 4>MS independence 41. What are the problems of distributed databases? The problems are )uery processing .atalog management 8pdate propagation #ecovery .oncurrency 42. Define client?ser<er s6stems. " clientIserver system is a distributed system in &hich

a% Some sites are client sites and some are server sites b% "ll data resides at the server sites c% "ll applications execute at the client sites, and d% 5the seams sho&

Unit III 1. What do 6ou mean b6 functional dependencies? *et # be a relation variable and let - and J be arbitrary subsets of the set of attributes of #. then &e say that J is functionally dependent on-in symbols, -J $read 5- functionally determines J,6 or simply 5 - arro& J 6%-if and only if in every possible legal value of #, each - =alue has associated &ith it precisely one J value. 2. What is a tri<ial dependenc6? " dependency is trivial if it cannot possibly fail to be satisfied. 3. What is a nontri<ial dependenc6? ,ontrivial dependencies are the ones that correspond to 5genuine6 integrity constraints. 4. Define 4eath@s theorem. *et #K",>,.Lbe a relvar, &here ",>, and . are sets of attributes. If # satisfies the 24 " >, then # is e9ual to the !oin of its pro!ections on K",>L and K",.L. ,. Define first normal form. " relvar is in ;,2 if and only if, in every legal value of that relvar, every tuple contains exactly one value for each attribute. 0. Define second normal form. " relvar is in :,2 if and only if it is in ;,2 and every non'ey attribute is irreducibly dependent on the primary 'ey. 1. Define third normal form.

" relvar is in A,2 if and only if it is in :,2 and every non'ey attribute is nontransitively dependent on the primary 'ey.

5. What is dependenc6 preser<ation? ,ormaliMation procedure should decompose relvars into pro!ections that are independent in #issanen@s sense has come to be 'no&n as dependency preservation. 7. Define o6ce?(odd normal form. " relvar is in >.,2 if and only if every nontrivial, left-irreducible 24 has a candidate 'ey as its determinant $ #% " relvar is in >.,2 if and only if every determinant is a candidate 'ey. 18. What is multi.<alued dependence? *et # be a relvar, and let ", > and . be subsets of the attributes of #. Then &e say that > is multi-dependent on "-in symbols, "> 11. Define 3agin theorem. *et #K",>,.L be a relvar, &here ", >, and . are sets of attributes. Then # is e9ual to the !oin of its pro!ections on K", >L and K", .L if and only if # satisfies the M=4s ">N.. 12. Define fourth normal form. #elvar # is in B,2 if and only if, &henever there exist subsets " and > of the attributes of # such that the nontrivial M=4 " > is satisfied, then all attributes of # are also functionally dependent on ". 13. What is a >oin dependenc6? *et # be a relvar, and let ", >,O. .P be subsets of the attributes of #. Then &e say that # satisfies the <4 QK", > OPL if and only if every legal value of # is e9ual to the !oin of its pro!ections on ", >, OOP. 14. Define fifth normal form.

" relvar # is in C,2-also called pro!ection-!oin normal form$+<I,2%-if and only if every nontrivial !oin dependency that is satisfied by # is implied by the candidate 'ey$s% of #, &here a. The !oin dependency QK", >,OO.PL on # is trivial if and only if atleast one of ", >,OP is the set of all attributes of #. b. The !oin dependency QK", >,OO.PL on # is implied by the candidate 'ey$s% of # if and only if each of ",>,O..,P is a super'ey of #.

1,. What is denormaliAation? *et #;,#:,O..,#n be a set of relvars. Then denormaliMing those relvars means replacing them by their !oin #, such that for all i $iR;,:,O..,n% pro!ecting # over the attributes of #i is guaranteed to yield #i again. Unit IB 1. Define reco<er6 in a database s6stem. #ecovery in a database system means, primarily, recovering the database itself1 that is, restoring the database to a correct state after some failure has rendered the current state incorrect, or at least suspect. 2. What is a transaction? " transaction is a logical unit of &or'1 it begins &ith the execution of a >(?I, T#",S".TI , operation, and ends &ith the execution of a . MMIT or # **>".7 operation. 3. What is a commit point? " commit point corresponds to the end of a logical unit of &or', and hence to a point at &hich the database is supposed to be in a correct state. 4. Discuss the &(ID properties. ".I4 properties are &tomicit6C Transactions are atomic

(orrectnessC Transactions transform a correct state of the database into another correct state, &ithout necessarily preserving correctness at all intermediate points IsolationC Transactions are isolated from one another. That is, even though in general there &ill be many transactions running concurrently, any given transaction@s updates all connected from all the rest, until that transaction commits. "nother &ay of saying the same thing is that, for any t&o distinct transactions " and > , " might see >@s updates or > might see "@s updates, but not both. Durabilit6C nce a transaction commits, its updates persist in the database, even if there is a subse9uent system crash. ,. What is a s6stem failure? System failures $e.g., po&er outage%, &hich affect all transactions currently in progress but do not physically damage the database. " system failure is sometimes called a soft crash. 0. What is a media failure? Media failures $e.g. head crash on the dis'%, &hich do cause damage to the database or some portion thereof, and affect at least those transactions currently using that portion. " media failure is sometimes called a hard crash. 1. What is a chec9 point record? The chec'point record contains a list of all transactions that &ere in progress at the time the chec'point &as ta'en. 5. !;pand &%I!'. The name "#I(S stands for 5"lgorithms for #ecovery and Isolation (xploiting Semantics.6 7. What are the three broad phases of &%I!'? "#I(S operates in three broad phases: &nal6sisC >uild the #(4 and 8,4 lists %edoC Start from a position in the log determined in the analysis phase and restore the database to the state it &as in at the time of the crash. UndoC 8ndo the effects of transactions that failed to commit.

18. What is a t:o.phase commit? T&o-phase commit is important &henever a given transaction can interact &ith several independent 5resource managers,6 each managing its o&n set of recoverable resources and maintaining its o&n recovery log.6 11. What is the need for sa<e points? It might be possible for a transaction to establish intermediate save points &hile it is executing, and subse9uently to roll bac' to a previously established save point, if re9uired, instead of having to roll bac' all the &ay to the beginning. 12. Define concurrenc6 .oncurrency refers to the fact that 4>MSs typically allo& many transactions to access the same database at the same time. 13. What are the three problems that an6 concurrenc6 control mechanism must address? The three problems are: The lost update problem The uncommitted dependency problem The inconsistent analysis problem 14. What is the last update problem? Transaction " retrieves some tuple t at time t;1 transaction > retrieves that same tuple t at time t:1 transaction " updates the tuple at time tA1 and transaction > updates the same tuple at time tB1 Transaction "@s update is lost at time tB, because transaction > over&rites it &ith-out even loo'ing at it. 1,. What is the uncommitted dependenc6 problem? The uncommitted dependency problem arises if one transaction is allo&ed to retrieve-or, &orse, update-a tuple that has been updated by another transaction but not yet committed by that other transaction. 10. What is the inconsistent anal6sis problem? 11. What is loc9ing?

15. What is deadloc9? 4eadloc' is a situation in &hich t&o or more transactions are in a simultaneous &ait state, each of them &aiting for one of the others to release a loc' before it can proceed. 17. What is serialiAabilit6? SerialiMability is the generally accepted 5criterion for correctness6 for the interleaved execution of a set of transactions1 that is, such an execution is considered to be correct if and only if it is serialiMable. 28. 'tate the t:o.phase loc9ing theorem T&o phase loc'ing theorem is 5If all transactions obey the t&o-phase loc'ing protocol, then all possible interleaved schedules are serialiMable6. 21. 'tate the t:o.phase loc9ing protocol. The t&o-phase loc'ing protocol is as follo&s >efore operating on any ob!ect a transaction must ac9uire a loc' on that ob!ect. "fter releasing a loc', a transaction must never go on to ac9uire any more loc's. 22. What is an isolation le<el? The isolation level that applies to a given transaction might be defined as the degree of interference the transaction in 9uestion is prepared to tolerate on the part of concurrent transactions. 23. What do 6ou mean b6 phantom problem? If transactions operate at less than the maximum isolation level is the so-called phantom problem 24. What is an intent loc9ing protocol? The intent loc'ing protocol, according to &hich no transaction is allo&ed to ac9uire a loc' on a tuple before first ac9uiring a loc'-probably an intent loc' on the relvar that contains it.

2,. What is loc9ing granularit6?

Unit B 1. What is cache memor6? The cache is the fastest and most costly form of storage. .ache memory is small1 its use is managed by the computer system hard&are. 2. What is main memor6? The storage medium used for data that are available to be operated on is main memory. The general-purpose machine instructions operate on main memory. "lthough main memory may contain many megabytes of data, or even hundreds of gigabytes of data in large server systems, it is generally too small for storing the entire database. The contents of main memory are usually lost if a po&er failure or system crash occurs. 3. What is flash memor6? ((+# M $(lectrically (rasable +rogrammable #ead nly Memory% 4ata in flash memory survive from po&er failure #eading data from flash memory ta'es about ;H nano-secs $roughly as fast as from main memory%, and &riting data into flash memory is more complicated: &rite-once ta'es about B-;H microsecs.

To over&rite &hat has been &ritten, one has to first erase the entire ban' of the memory. It may support only a limited number of erase cycles $;H B to ;HD%.

It has found its popularity as a replacement for dis's for storing small volumes of data $C-;H megabytes%.

4. What is magnetic dis9 storage? +rimary medium for long-term storage. Typically the entire database is stored on dis'. 4ata must be moved from dis' to main memory in order for the data to be operated on. "fter operations are performed, data must be copied bac' to dis' if any changes &ere made. 4is' storage is called direct access storage as it is possible to read data on the dis' in any order $unli'e se9uential access%. 4is' storage usually survives po&er failures and system crashes.

,. What is optical storage? The most popular form of optical storage are .4-# M$compact dis' read only memory%, S #M $&rite-once read-many%dis' $for archival storage of data%, and <u'e box$containing a fe& drives and numerous dis's loaded on demand%. 0. What is tape storage? Tape storage used for primarily for bac'up and archival data. .heaper, but much slo&er access, since tape must be read se9uentially from the beginning. 8sed as protection from dis' failures.

1. Dra: the storage de<ice hierarch6.

.ache

Main memory

2lash memory

Magnetic dis' ptical dis' Magnetic tapes

5. What is '&# architecture? In the storage area net&or' $S",% architecture, large numbers of dis's are connected by a high-speed net&or' to a number of server computers. 7. What is #&'? ,et&or' attached storage $,"S% is an alternative to S",. ,"S is much li'e S",, except that instead of the net&or'ed storage appearing to be a large dis', it provides a file system interface using net&or'ed file system protocols such as ,2S or .I2S. 18. Define access time

"ccess time is the time from &hen a read or &rite re9uest is issued to &hen data transfer begins. 11. Define see9 time. To access data on a given sector of a dis', the arm first must move so that it is positioned over the correct trac', and then must &ait for the sector to appear under it as the dis' rotates. The time for repositioning the arm is called the see' time. 12. Define a<erage see9 time. The average see' time is the average of the see' times, measured over a se9uence of random re9uests. 13. Define rotational latenc6 time. nce the head has reached the desired trac', the time spent &aiting for the sector to be accessed to appear under the head is called the rotational latency time 14. Define a<erage latenc6 time. "verage latency time of the dis' is one-half the time for a full rotation of the dis'. 1,. Define data.transfer rate. The data-transfer rate is the rate at &hich data can be retrieved from or stored to the dis'. 10. Define mean time to failureDM$$3E Mean time to failure is a measure of the reliability of the dis'. The mean time to failure of a dis' is the amount of time that, on average, &e can expect the system to run continuously &ithout any failure. 11. What is %&ID? " variety of dis' organiMation techni9ues, collectively called redundant arrays of independent dis's $#"I4%, have been proposed to achieve improved performance and reliability.

15. What is mirroring? The simplest approach to introducing redundancy is to duplicate every dis'. This techni9ue is called mirroring.

17. What are the factors to be ta9en into account in choosing a %&ID le<el? The factors to be ta'en into account in choosing a #"I4 level are Monetary cost of extra dis'-storage re9uirements +erformance re9uirements in terms of number of II operations +erformance &hen a dis' has failed. +erformance during rebuild$that is, &hile the date in a failed dis' are being rebuilt on a ne& dis'% 28. What is heap file organiAation? "ny record can be placed any&here in the file &here there is space for the record. There is no ordering of records. Typically, there is a single file for each relation. 21. What is se=uential file organiAation? #ecords are stored in se9uential order, according to the value of a 5search 'ey6 of each record. 22. What is hashing file organiAation? " hash function is computed on some attribute of each record. The result of the hash function specifies in &hich bloc' of the file the record should be placed, 23. What is a multitable clustering file organiAation? " multitable clustering file organiMation is a file organiMation that stores related records of t&o or more relations in each bloc'. Such a file organiMation allo&s us to read records that &ould satisfy the !oin condition by using one bloc' read. 24. What is an inde;ing? 2,. What are the t:o basic 9inds of indices? The T&o basic 'inds of indices are rdered indices 3ash indices

20. What is access t6pes?

The types of access that are supported efficiently. "ccess types can include finding records &ith a specified attribute vale and finding records &hose attribute values fall in a specified range. 21. What is access time? The time it ta'es to find a particular data item, or set of items, using the techni9ue in 9uestion. 25. What is insertion time? The time it ta'es to insert a ne& data item. This value includes the time it ta'es to find the correct place to insert the ne& data item, as &ell as the time it ta'es to update the index structure. 27. What is deletion time? The time it ta'es to delete a data item. This value includes the time it ta'es to find the item to be deleted, as &ell as the time it ta'es to update the index structure. 38. What is space o<erhead? The additional space occupied by an index structure. +rovided that the amount of additional space is moderate, it is usually &orth-&hile to sacrifice the space to achieve improved performance. 31. What is a search 9e6? "n attribute or set of attributes used to loo' up records in a file is called a search 'ey. 32. What is an clustering inde; DorE primar6 inde;? .lustering index is an index &hose search 'ey also defines the se9uential order of the file. 33. What is an nonclustering inde; DorE secondar6 inde;? Indices &hose search 'ey specifies an order different from the se9uential order of the file are called nonclustering indices. 34. What is an inde;.se=uential file? "ll files are ordered se9uentially on some search 'ey. Such files, &ith a clustering index on the search 'ey, are called index-se9uential files. 3,. What is an inde; record?

"n index record, or index entry, consists of a search 'ey vale and pointers to one or more records &ith that value as their search-'ey value. 30. What is a dense inde;? "n index record appears for every search-'ey value in the file. In a dense clustering index, the index record contains the search-'ey value and a pointer to the first data record &ith that search-'ey value. The rest of the records &ith the same search-'ey value &ould be stored se9uentially after the first record, since, because the index is a clustering one, records are stored on the same search 'ey. 4ense index implementations may store a list of pointers to all records &ith the same search-'ey value1 doing so is not essential for clustering indices. 31. What is a sparse inde;? "n index record appears for only some of the search-'ey values. as is true in dense indices, each index record contains a search-'ey value and a pointer to the first data record &ith that search-'ey value. To locate a record, &e find the index entry &ith the largest search-'ey value that is less than or e9ual to the search-'ey value for &hich &e are loo'ing. Se start at the record pointed to by that index entry, and follo& the pointers in the file until &e find the desired record. 35. What is a multile<el indices? Indices &ith t&o or more levels are called multilevel indices. 37. What is a balanced tree? >alanced tree in &hich every path from the root of the tree to the leaf of the tree is of the same length. 48. Write the =uer6ing a F tree. +rocedure find $value =% Set . R root node Shile . is not a leaf node begin *et 7iR smallest search-'ey value, if any, greater than = If there is no such value then begin *et m R the number of pointers in the node Set .R node pointed to by +m (nd

(lse set .R the node pointed to by +i (nd If there is a 'ey value 7i R= Then pointer +i directs us to the desired record or buc'et (lse no record &ith 'ey value ' exists. 41. Define hashing. 3ashing allo& us to avoid accessing an index structure. It provides a &ay of constructing indices. 42. Define a buc9et. The term buc'et to denote a unit of storage that can store one or more records. " buc'et is typically a dis' bloc', but could be chosen to be a smaller or larger than a dis' bloc'. 43. Define hash function. " hash function h is a function from 7 to >. *et h denote a hash function 44. What are the t:o different purposes of hashing? 3ashing can be used for t&o different purposes. 3ash file organiMation 3ash index organiMation

4,. What is a hash inde;? " hash index organiMes the search 'eys, &ith their associated pointers, into a hash file structure. 40. What is d6namic hashing? 4ynamic hashing techni9ues allo& the hash function to be modified dynamically to accommodate the gro&th or shrin'age of the database. 41. What are the steps in<ol<ed in =uer6 processing? The steps involved in processing a 9uery are +arsing and translation ptimiMation (valuation

45. What is a e=ui.>oin?

47. Write the nested.loop >oin algorithm. 2or each tuple tr in r do begin 2or each tuple ts in s do begin Test pair$tr,ts%to see if they satisfy the !oin condition If they do,add tr.ts to the result (nd (nd ,8. Write the bloc9 nested.loop >oin and its algorithm. >loc' nested-loop !oin, &hich is a variant of the nested loop !oin &here every bloc' of the inner relation is paired &ith every bloc' of the outer relation. 2or each bloc' >r of r do begin 2or each bloc' >s of s do begin 2or each tuple tr in >r do begin 2or each tuple ts in >s do begin Test pair$tr,ts% to see if they satisfy the !oin condition If they do, add tr.ts to the result. (nd (nd (nd (nd ,1. What is an inde;ed nested.loop >oin. Indexed nested loop !oin can be used &ith existing indices, as &ell as &ith temporary indices created for the sole purpose of evaluating the !oin. ,2. What is a merge >oin? The merge-!oin algorithm can be used to compute natural !oins and e9ui-!oins. ,3. What is a hash.>oin? The hash-!oin algorithm can be used to implement natural !oins and e9ui-!oins. ,4. What are the contents of D M' catalog? The 4>MS catalog stores the follo&ing statistical information about database relations:

nr,the number of tuples in the relation r br, the number of bloc's containing tuples of relation r lr, the siMe of a tuple of relation r in bytes fr,the bloc'ing factor of relation r-that is,the number of tuples of relation r that fit into one bloc' =$",r%,the number of distinct values that appear in the relation r for attribute ". This value is the same as the siMe of relation r,=$",r%is nr $r%.If " is a 'ey for

,,. What is an histogram? In histogram the values for the attribute are divided into a number of ranges, and &ith each range the histogram associates the number of tuples &hose attribute value lies in that range.

Vous aimerez peut-être aussi