Archives
Software Design & Engineering Chapter 10 Model attribute in Products cannot be a reference
Exercise 10.3.5 Section 10.4 Exercise 10.4.1 Movies( title TitleType, year YearType, length DurationType, genre GenreType, studioName BusinessNameType, producerC# CertificateType ) MovieStar( name PersonNameType, address AddressType, gender GenderType, birthdate DateType ) StarsIn( movieTitle TitleType, movieYear YearType, starName PersonNameType ) MovieExec( name […]
Software Design & Engineering Chapter 10 The Grant Diagram After The Final Step
Solutions Manual Chapter 10 Section 10.1 Exercise 10.1.1 (a) SELECT on MovieStar, SELECT on MovieExec. (b) SELECT on MovieExec, SELECT on Movies, SELECT on StarsIn. (e) UPDATE on MovieExec (or UPDATE(name) on MovieExec). (f) REFERENCES on MovieStar (or REFERNCES(gender, name) […]
Software Design & Engineering Chapter 11 The singular form of the relation name should
Section 1 Exercise 11.1.1 a) b) c) Exercise 11.1.2 Exercise 11.1.3 <Name>Carrie Fisher</Name> <Address> <Street>123 Maple St.</Street> <City>Hollywood</City> </Address> <Address> <Street>5 Locust Ln.</Stree> <City>Malibu</City> </Address> </Star> <Star starID = “mh” starredIn = “sw”> <Name>Mark Hamill</Name> <Address> Exercise 11.1.4 Exercise 11.1.5 […]
Software Design & Engineering Chapter 12 For dense index we need a key-pointer pair
2500 959 649 3673 239 100 200 <Printer model=”3006″ price=”100″>…</Printer> <Printer model=”3007″ price=”200″>…</Printer> A E 1001 1002 A E Section1 Exercise 12.1.1 a) //PC/RAM <RAM>1024</RAM> b) //@price 2114 995 1150 c) //Printer <Printer model=”3002″ price=”239″>…</Printer> d) /Products/Maker[Printer/Type = “laser”]/@name E […]
Software Design & Engineering Chapter 13 For Instance There Will Only One Disk
Solutions Manual Chapter 13 Section 13.1 Exercise 13.1.1 For this exercise we treat the sizes as if they were powers of 10 (i.e. petabyte is 1015). Results would be slightly different if powers of 2 were used (i.e. petabyte is […]
Software Design & Engineering Chapter 14 For the sparse index we need a key-pointer
Solutions Manual Chapter 14 Section 14.1 Exercise 14.1.1 (a) For dense index we need a key-pointer pair for each record, and so will need n 10 blocks. For the data, we will need n 3blocks, and so the total number […]
Software Design & Engineering Chapter 14 This Means That Picking The First Index
— (d) i = 3, n = 8, r = 16 — 1000 000 0000 — 1001 001 0001 — 1010 010 0010 — 1011 011 0011 — 1100 100 0100 — 1101 101 0101 — 1110 110 0110 — […]
Software Design & Engineering Chapter 15 Nested-loop join needs to be used to join
R . C lo s e ( ) ; S . Open ( ) ; GetNext ( ) {xT u ple ←g e t t h e s m a l l e s t t u p l e […]
Software Design & Engineering Chapter 15 Not found Exhausted Reset For Next Tuple Close
r e t u r n joined c u r r T u p l e and matched tuple from H ; } / / We come here if did not find a match; read next tuple in R c […]
Software Design & Engineering Chapter 15 Otherwise Insert Tuple Into Initializing Counter
Solutions Manual Chapter 15 Section 15.2 Exercise 15.2.1 (a) The pseudocode for the iterator for projection πA1,A2,..,An(R) is as follows: Open ( ) { R . Open ( ) ; } GetNext ( ) 2 { xTuple ←R . GetNe […]
Software Design & Engineering Chapter 16 A is recoverable for transaction U. Logging
• ❑ b <Condition> ::= <Attribute> > <Attribute> <Condition> ::= <Attribute> >= <Attribute> <Condition> ::= <Attribute> < <Attribute> <Condition> ::= <Attribute> <= <Attribute> • ❑ c <Condition> ::= ( <Condition> ) • ❑ d <Condition> ::= EXISTS ( <Query> ) […]
Software Design & Engineering Chapter 17 Logging does not preserve atomicity
u = + u Write(B, u) Output(B) crash here ok t = t + u Write(A) Output(A) Write(A) u = t + 1 Write(B) Output(B) crash here ok Output(A) Database Systems: The Complete Book ▼ ❑ Chapter 17 ▼ ❑ […]
Software Design & Engineering Chapter 18 it doesn’t matter whether we first set the angle
1 2 3 4 5 6 w2(D)u2(D)u2(B)u2(C) 18.4.4 Schedule is r1(A)r1(B)w1(B)r1(C)w1(C)r1(D)w1(D)r1(E)w1(E) With locks: Ul1(A)r1(A)ul1(B)r1(B)xl1(B)w1(B)ul1(C)r1(C)xl1(C)w1(C)ul1(D)r1(D)xl1(D)w1(D)ul1(E)r1 (E)xl1(E)w1(E) (Quest: shared or update lock better for concurrency?) 18.4.5a) Requested S X M S Yes No No X No No No M No No Yes […]
Software Design & Engineering Chapter 18 Think of the interleaving as having 10 positions
18.1.1) r1(A); r1(B); w1(B); r1(C); w1(C); r1(D); w1(D); r1(E); w1(E) 18.1.2) Think of the interleaving as having 10 positions. The 4 actions of the first transaction occupy any 4 of the 10, so the number of interleavings is (10 choose […]
Software Design & Engineering Chapter 19 The difference between strict and nonstrict
T3 rolled back since it reads C written by T2. wrote D, but no transaction has read D, so no further rollbacks are needed. T3 rolled back since it reads B written by T1. uncommitted. If lost tail starts between […]
Software Design & Engineering Chapter 2 For relation Accounts and the first tuple
Exercise 2.2.1a For relation Accounts, the attributes are: Exercise 2.2.1b For relation Accounts, the tuples are: (12345, savings, 12000), (23456, checking, 1000), (34567, savings, 25) For relation Customers, the tuples are: (Robbie, Banks, 901-222, 12345), (Lena, Hand, 805-333, 12345), (Lena, […]
Software Design & Engineering Chapter 2 The Theta Join Can Modeled Cartesian Product
(maker4 = maker AND (model4=model OR model4=model2 OR model4=model3)) πmaker Exercise 2.4.3a R1 := σbore ≥ 16 (Classes) R2 := πclass,country (R1) class country Iowa USA North Carolina USA Yamato Japan Exercise 2.4.3b Product PC πmaker,model ρR2(maker2,model2) ρR3(maker3,model3) ρR4(maker4,model4) (maker […]
Software Design & Engineering Chapter 20 Ready Then Both And Send The Final
emits the pair (w, i), where i is the id of the document d. The intermediate result is a list of pairs (w1, i1),(w2, i2),…. The input to reduce function is a pair (w, [i1, i2, …, in]), where the […]
Software Design & Engineering Chapter 21 Each Resolution Step Will Introduce New Possibilities
Computers_g (cID, proc, speed, memory, hd) Monitors_g (mID, screen, maxResX, maxResY) Systems_g (sID, mID) INSERT INTO Monitors_g SELECT number, screen, maxResX, maxResY from Monitors INSERT INTO Systems_g SELECT id, number from Systems, Monitors WHERE Systems.screenSize = Monitors.Screen (Note: We could […]
Software Design & Engineering Chapter 22 Each processor is assigned to count pairs for
Reduce: Each processor is assigned to count a single item. • ❑ b Map: Each processor counts all local items. Reduce: Each processor is assigned to count pairs for a bucket. ▼ ❑ Section 3 • ❑ 1 {1, 2, […]
Software Design & Engineering Chapter 23 The map function takes in, as parameters
P2 = (0.1375, 0.25, 0.3006, 0.3119) P3 = (0.1603, 0.2272, 0.2778, 0.3347) P4 = (0.15, 0.2477, 0.2778, 0.3244) P5 = (0.15, 0.2385, 0.2825, 0.3290) … P9 = (0.1513, 0.2406, 0.2806, 0.3276) P10 = (0.1513, 0.2406, 0.2806, 0.3276) P = (0.1513, […]
Software Design & Engineering Chapter 3 The reason why the positions would be a key
Exercise 3.1.1 Answers for this exercise may vary because of different interpretations. Some possible FDs: Social Security number → name Exercise 3.1.2 Answers for this exercise may vary because of different interpretations Some possible FDs: ID → x-position, y-position, z-position […]
Software Design & Engineering Chapter 3 The second step to verify that the given
We also found out that the keys are AB, AC and AD. FDs where the left side is not a superkey or the attributes on the right are not part of some key are 3NF violations. The 3NF violations are […]
Software Design & Engineering Chapter 4 Each and every object is a member of exactly
4.7.6 4.7.7 4.7.8 We convert the ternary relationship Contracts into three binary relationships between a new entity set Contracts and existing entity sets. 4.7.9 a) b) c) 4.7.10 A self-association ParentOf for entity set people has multiplicity 0..2 at parent […]
Software Design & Engineering Chapter 4 For The Person Relation Least One Husband
4.4.3 a) b) c) 4.4.4 a) b) 4.5.1 Customers(SSNo,name,addr,phone) Flights(number,day,aircraft) Bookings(custSSNo,flightNo,flightDay,row,seat) Relations for toCust and toFlt relationships are not required since the weak entity set Bookings already contains the keys of Customers and Flights. 4.5.2 (a) (b) Schema is changed. […]
Software Design & Engineering Chapter 4 Studios Entity Set Contact Can Associated With
Solutions Chapter 4 4.1.1 4.1.2 a) b) c) In c we assume that a phone and address can only belong to a single customer (1– m relationship represented by arrow into customer). d) In d we assume that an address […]
Software Design & Engineering Chapter 5 Therefore The Law Holds For Sets But
Exercise 5.1.1 As a set: speed 2.66 2.10 1.42 As a bag: speed 2.66 2.10 1.42 2.80 3.20 3.20 2.20 2.20 2.00 2.80 1.86 2.80 3.06 Average = 2.48 Exercise 5.1.2 As a set: 2.80 3.20 2.20 2.00 1.86 3.06 […]
Software Design & Engineering Chapter 6 However no such restriction exists for executives
b) SELECT DISTINCT C.class FROM Classes C, Ships S WHERE C.class = S.class AND EXISTS c) SELECT S.name FROM Ships S WHERE S.class IN (SELECT class FROM Classes C WHERE bore=16 ) ; SELECT S.name FROM Ships S WHERE EXISTS […]
Software Design & Engineering Chapter 6 Select R model P price From Product Where R maker
Solutions Chapter 6 6.1.1 Attributes must be separated by commas. Thus here B is an alias of A. 6.1.2 a) SELECT address AS Studio_Address FROM Studio WHERE NAME = ‘MGM’; c) SELECT starName FROM StarsIn WHERE movieYear = 1980 OR […]
Software Design & Engineering Chapter 6 Values Italia Vittorio Veneto 1940 Ships Values
b) SELECT DISTINCT C.class FROM Classes C, Ships S , c) SELECT S.name FROM Ships S, Classes C WHERE C.class = S.class AND C.bore =16 ; d) SELECT O.battle FROM Outcomes O, Ships S WHERE S.Class =’Kongo’ AND S.name = […]
Software Design & Engineering Chapter 7 To declare such a foreign-key constraint
length INT, genre CHAR(10), studioName CHAR(30), producerC# INT REFERENCES MovieExec(cert#) ON DELETE SET NULL ON UPDATE SET NULL, PRIMARY KEY (title, year) ); length INT, genre CHAR(10), studioName CHAR(30), producerC# INT REFERENCES MovieExec(cert#) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY […]
Software Design & Engineering Chapter 8 And Year Old year Update Movie prod Set Year
b) SELECT RichExec.name from RichExec, StudioPres where RichExec.name = StudioPres.name; c) SELECT ExecutiveStar.name from ExecutiveStar, StudioPres WHERE ExecutiveStar.netWorth >= 50000000 AND StudioPres.cert# = RichExec.cert#; CREATE VIEW StudioPres (name, address, cert#) AS SELECT MovieExec.name, MovieExec.address, MovieExec.cert# FROM MovieExec WHERE MovieExec.cert# IN […]
Software Design & Engineering Chapter 9 End While Close Movie cursor End Create Procedure
9.3.1 a) In the following, we use macro NOT_FOUND as defined in the section. void closestMatchPC() { EXEC SQL BEGIN DECLARE SECTION; char manf, SQLSTATE[6]; int targetPrice, /* holds price given by user */ /* ask user for target price […]
Software Design & Engineering Chapter 9 Update Battles Set Date Where Name
SQLBindCol(execStat, 1, SQL_CHAR, model, sizeof(model), &colInfo); SQLBindCol(execStat, 2, SQL_FLOAT, speed, sizeof(speed), &colInfo); while(SQLFetch(execStat) != SQL_NO_DATA) { if( FOUND ) /* print fetched info */ } /* get Printers made by the manufacturer */ SQLPrepare(execStat, “SELECT * FROM Printer WHERE model […]
Software Design & Engineering Chapter 9 We must get its manufacturer with a single
else { printf(“pc model: %s\n”, pc_model); } /* get Printer within the budget */ rest_budget = total_budget – pc_price; color = “true”; if (!rs.next()) { color = “false”; execStat.setInt(1, rest_budget); execStat.setString(2, color); ResultSet rs = execStat.executeQuery(); print_model = rs.getString(1); print_price […]