Professional Documents
Culture Documents
Concepts of Database Management 8Th Edition Pratt Solutions Manual Full Chapter PDF
Concepts of Database Management 8Th Edition Pratt Solutions Manual Full Chapter PDF
Solution Manual:
https://testbankpack.com/p/solution-manual-for-concepts-of-database-management-
8th-edition-by-pratt-last-isbn-1285427106-9781285427102/
Test bank:
https://testbankpack.com/p/test-bank-for-concepts-of-database-management-8th-
edition-by-pratt-last-isbn-1285427106-9781285427102/
Chapter 3
Solutions
©2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use.
Concepts of Database Management, Eighth Edition Solutions 3-2
3. A compound condition is formed by connecting two or more simple conditions using one or both of the
following operators: AND and OR. You can also precede a single condition with the NOT operator to negate a
condition. When you connect simple conditions using the AND operator, all the simple conditions must be true
for the compound condition to be true. When you connect simple conditions using the OR operator, the
compound condition will be true whenever any of the simple conditions are true.
4. A computed field is one whose values are calculated from other fields. To use a computed field in an SQL
query, type the desired calculation. To assign a name to a computed field, follow the calculation with the word
AS and then the desired name.
5. To use the LIKE or IN operators in an SQL query, include them in the WHERE clause. A character string
containing one or more wildcards is included after the word LIKE. The word IN is followed by a list of values.
6. To sort data, use the ORDER BY clause, which consists of the words ORDER BY followed by the sort key. If
there is more than one sort key, the major key is listed first. To sort data in descending order, follow the sort
key with the word DESC.
7. Use an SQL built-in function (COUNT, SUM, AVG, MAX, and MIN) by including it in the SELECT clause
followed by the name of the field to which it applies.
8. A subquery is a query that is included in another query. The subquery is evaluated before the query that
contains it.
9. To group data in SQL, include the words GROUP BY followed by the field or fields on which the data is to be
grouped in the query results. If you group data, you only can include the fields on which you are grouping or
statistics in the SELECT clause.
10. To join tables in SQL, use a SELECT command that lists two or more tables to be joined in the FROM clause,
and then specify the matching columns in the WHERE clause.
11. To qualify the name of a field in an SQL query, precede the field with the name of the table to which it
belongs, followed by a period. It is necessary to qualify a field if the field name occurs in more than one of the
tables listed in the FROM clause.
12. To take the union of two tables, create a SQL query for each table and then place the word UNION between
the queries. The two tables involved in a union must have the same structure, or be union compatible; in other
words, they must have the same number of fields and their corresponding fields must have the same data types.
13. The update commands in SQL are INSERT, which inserts new rows in a table; UPDATE, which changes all
the rows in a table that satisfy some condition; and DELETE, which deletes all the rows in a table that satisfy
some condition.
14. Create a query to select the columns from the desired table. After the SELECT clause, include an INTO clause
followed by the name of the table to be created.
15. [Critical Thinking] The data type for PostalCode is CHAR because the values stored in the field are not used in
any calculations. Also, if you did use either SMALLINT or INTEGER data type, then leading zeroes would be
dropped. There are many postal codes in the New England area that start with zero. The field is long enough if
the DBA has decided to store 5-digit US postal codes. It is not long enough if the postal codes will include
codes outside the US or if the 99999-9999 version of the US postal code is necessary.
16. [Critical Thinking] The command will delete all records in the OrderLine table because there is no criterion
included in the SQL statement. To delete the entire table from the database use the following command:
DROP TABLE OrderLine;
©2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use.
Concepts of Database Management, Eighth Edition Solutions 3-3
©2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use.
Concepts of Database Management, Eighth Edition Solutions 3-4
SELECT *
FROM Item
ORDER BY Category, ItemNum;
Or
3.
©2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use.
Concepts of Database Management, Eighth Edition Solutions 3-5
SELECT TripName
FROM Trip
WHERE Type = 'Hiking'
AND Distance > 6;
4.
SELECT TripName
FROM Trip
WHERE Type = 'Paddling'
OR State = 'VT';
5.
SELECT COUNT(*)
FROM Trip
WHERE Type = 'Hiking'
OR Type = 'Biking';
6.
SELECT TripName, Type, MaxGrpSize
FROM Trip, Guide, TripGuides
WHERE Trip.TripID = TripGuides.TripID
AND Guide.GuideNum = TripGuides.GuideNum
AND LastName = 'Kiley';
7.
SELECT TripName, State
FROM Trip
WHERE Season = 'Summer'
ORDER BY State, TripName;
©2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use.
Concepts of Database Management, Eighth Edition Solutions 3-6
8.
SELECT TripName
FROM Trip, Guide, TripGuides
WHERE Trip.TripID = TripGuides.TripID
AND Guide.GuideNum = TripGuides.GuideNum
AND LastName = 'Boyers'
AND Type = 'Hiking';
9.
SELECT State, COUNT(*)
FROM Trip
GROUP BY State
ORDER BY State;
10.
SELECT COUNT(*)
FROM Reservation
WHERE TripPrice > 20 AND TripPrice < 75;
11.
SELECT ReservationID, LastName, TripName
FROM Reservation, Trip, Customer
WHERE Reservation.TripID = Trip.TripID
AND Reservation.CustomerNum = Customer.CustomerNum
AND NumPersons > 4;
12.
SELECT TripName, FirstName, LastName
FROM Trip, Guide, TripGuides
WHERE Trip.TripID = TripGuides.TripID
AND Guide.GuideNum = TripGuides.GuideNum
AND Trip.State = 'NH'
ORDER BY TripName, LastName;
13.
SELECT ReservationID, Reservation.CustomerNum, LastName, FirstName
FROM Reservation, Customer
WHERE Reservation.CustomerNum = Customer.CustomerNum
AND TripDate > #6/30/2016# AND TripDate <#8/1/2016#;
14.
SELECT ReservationID, TripName, LastName, FirstName, ((TripPrice +
OtherFees)*NumPersons) AS TotalCost
FROM Reservation, Trip, Customer
WHERE Reservation.TripID = Trip.TripID
AND Reservation.CustomerNum = Customer.CustomerNum
AND NumPersons > 4;
15.
SELECT ReservationID, TripID, TripDate, TripPrice, OtherFees, CustomerNum INTO
Solo
FROM Reservation
WHERE NumPersons = 1;
16.
UPDATE Solo SET OtherFees = 5
WHERE OtherFees = 0;
©2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use.
Concepts of Database Management, Eighth Edition Solutions 3-7
17.
DELETE *
FROM Solo
WHERE TripDate = #9/12/2016#;
18. [Critical Thinking] The alternate ways to create the query in Step 13 are:
SELECT ReservationID, Reservation.CustomerNum, LastName, FirstName
FROM Reservation, Customer
WHERE Reservation.CustomerNum = Customer.CustomerNum
AND TripDate > #6/30/2016# AND TripDate <#8/1/2016#;
or
SELECT ReservationID, Reservation.CustomerNum, LastName, FirstName
FROM Reservation, Customer
WHERE Reservation.CustomerNum = Customer.CustomerNum
AND TripDate >= #7/1/2016# AND TripDate <=#7/31/2016#;
or
SELECT ReservationID, Reservation.CustomerNum, LastName, FirstName
FROM Reservation, Customer
WHERE Reservation.CustomerNum = Customer.CustomerNum
AND TripDate Between #7/1/2016# AND #7/31/2016#;
19. [Critical Thinking] TripID in the SELECT clause must be qualified because it is in both the Trip table and the
Reservation table. The correct code is:
SELECT ReservationID, Reservation.TripID, TripName
FROM Reservation, Trip
WHERE Reservation.TripID = Trip.TripID
©2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use.
Concepts of Database Management, Eighth Edition Solutions 3-8
FROM CondoUnit
WHERE Bdrms = 3;
7.
SELECT UnitNum
FROM CondoUnit
WHERE Bdrms = 3
AND LocationNum = 1;
8.
SELECT LocationNum, UnitNum
FROM CondoUnit
WHERE CondoFee BETWEEN 200 AND 300;
9.
SELECT UnitNum
FROM CondoUnit
WHERE CondoFee < 200
AND LocationNum = 2;
10. .
SELECT CondoId, CategoryNum, EstHours, 35 * EstHours AS EstimatedCost
FROM ServiceRequest;
11.
SELECT OwnerNum, LastName
FROM Owner
WHERE State IN ('FL','GA','SC');
12.
SELECT LocationNum, UnitNum, SqrFt, CondoFee
FROM CondoUnit
ORDER BY SqrFt, CondoFee;
13.
SELECT LocationNum, COUNT(*)
FROM CondoUnit
WHERE Bdrms = 2
GROUP BY LocationNum
ORDER BY LocationNum;
14.
SELECT SUM(CondoFee)
FROM CondoUnit;
15.
SELECT LocationNum, UnitNum, CondoUnit.OwnerNum, FirstName, LastName
FROM CondoUnit, Owner
WHERE CondoUnit.OwnerNum = Owner.OwnerNum;;
16.
SELECT CondoID, Description, Status
FROM ServiceRequest, ServiceCategory
WHERE ServiceRequest.CategoryNum = ServiceCategory.CategoryNum
AND CategoryDescription = 'Painting';
17.
©2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use.
Concepts of Database Management, Eighth Edition Solutions 3-9
18.
SELECT * INTO LargeCondo
FROM CondoUnit
WHERE SqrFt > 1500;
19.
UPDATE LargeCondo SET CondoFee = 550
WHERE CondoFee = 300;
20.
DELETE *
FROM LargeCondo
WHERE CondoFee = 670;
21. [Critical Thinking] The two ways to create the command for the query in Step 11 are:
example,
SELECT *
FROM ServiceRequest
WHERE Description LIKE '*pantry*';
Instructor Note: If you are using Oracle replace the asterisk with the percent symbol:
SELECT *
FROM ServiceRequest
WHERE Description LIKE '%pantry%';
©2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use.
Another random document with
no related content on Scribd:
mm. × 48 mm., the ordinary size on the adjoining banks being only
about 50 to 60 × 30 mm.
Some observations have already been recorded (p. 40) on the
growth of Helix aspersa. In the summer of 1858, which was very dry,
especially in the south of France, the young Helices born that year
were still very small in August. About the end of that month abundant
rain came on, and in four or five days young H. variabilis, H. pisana,
and H. aspersa, eating without cessation, as if to make up for lost
time, grew more than a centimetre of shell. The lip of a young H.
arbustorum has been observed to have grown, at the end of the first
week in the season’s growth, 3 mm., at the end of the second week,
6·25 mm., the third, 11·5 mm., and the fourth 12·5 mm., with a
finished lip.[342]
Careful observation has shown that in the growth of the shell of
Helix aspersa the periostracum is first produced; it is covered with
hyaline globules, 10–12 mm. in diameter, which persist even in the
oldest shells. Calcareous matter is deposited on the internal face of
the new periostracum, at some distance from the margin. It is
secreted by a white zone or band of cells bounding the entire
breadth of the mantle as applied to the peristome. Immediately
behind the white zone are a series of pigment cells which not only
give the shell its colour but complete the calcification of the shelly
matter laid down by the white zone. When the animal has attained its
full growth and the lip is finished off, the white band and the
periostracum cells completely disappear, and only such cells persist
as contribute to the internal thickening of the shell. Shell growth, in
this species, is very rapid. If a portion of the pulmonary sac is laid
bare, by removing a fragment of shell, at the end of 1½ or 2 hours
there may be detected a delicate organic membrane covering the
hole, and strewn with crystals of carbonate of lime. This thickens
with great rapidity, and soon fills up the hole with solid matter. For
two consecutive months an animal, deprived of food, has been
known to reproduce this membrane daily after its removal every
morning.[343] Prof. Schiedt has found that oysters, if deprived of the
right valve and exposed to the light, not only develop brown pigment
over the whole exposed surface of mantle and branchiae, but
actually succeed in part in reproducing the valve and hinge.[344]
Deposit of Additional Layers of Shell.—Mollusca possess the
power of thickening the interior of the shell, by the deposit of
successive layers. This is frequently done in self-defence against the
attacks of boring Mollusca, sponges, and worms. Cases may often
be noticed of Ostrea, Spondylus, and other sedentary molluscs,
which, unable to escape the gradual assaults of their foes, have
provided against them by the deposit of fresh shelly matter. A
somewhat similar plan is adopted to provide against intrusion by way
of the aperture. Pearls are, in many cases, the result of shell
deposition upon the eggs or even the body of some intrusive
parasite (Distoma, Filaria, etc.), and are, in some countries,
artificially produced by the introduction of fragments of sand, metal,
etc., into living Unio and Anodonta. Little joss images are made in
India and China, the nacre on which is produced by thrusting them
inside living Unionidae.
A specimen of Helix rosacea, in the British Museum, into whose
shell a piece of grass somehow became introduced, has partitioned
it off by the formation of a sort of shelly tunnel extending throughout
its entire length (Fig. 167).
Fig. 167.—A specimen of Helix
rosacea Müll., Cape of Good
Hope, into which a piece of
grass has by some means
become introduced. The
animal has protected itself by
covering the grass with a
shelly layer. (From a
specimen in the British
Museum.)
Absorption of Internal Portions.—Certain genera have the
remarkable property of absorbing, when they become adult, the
internal portions of the whorls and the greater part of the columellar
axis. The effect of this is to make the shell, when the process is
complete, no longer a spiral but a more or less produced cone, and it
is found that in such cases the viscera of the spire lose their spiral
form, and take the shape of the cavity in which they lie. Amongst the
genera in which this singular process takes place are Nerita,[345]
Olivella, and Cypraea amongst marine forms, and nearly the whole
of the Auriculidae[346] (Fig. 168). Conus reduces the internal
subdivisions of the spire to extreme thinness. It is noticeable that
these genera are all of considerable thickness of shell, and it is
perhaps the result of the whole energy of the animal being directed
to the formation of its external protection that the internal walls of the
spire become atrophied and eventually disappear.
Fig. 168.—Auricula Judae Lam.,
showing the disappearance
of the partitions of the
whorls, which are
represented by dotted lines.
(After Fischer.)
The Slit.—Many shells are furnished with a slit in the last whorl,
which opens, in most cases, on the outer lip, and is sometimes of
considerable depth, at others a mere notch. In the patelliform shells
it is always in front of the apex. The function of the slit appears to be
mainly anal, the excretory products being thus allowed to escape by
a passage of their own, without soiling the clean water taken in by
the branchiae. The posterior canal of some Gasteropoda probably
performs a similar function. In the adult Fissurella the slit becomes
an apical hole (see Fig. 178 F), in the allied genera it is either
immediately in front of the spire (Puncturella), or half-way between
the spire and the anterior margin (Rimula), or on the margin and well
marked (Emarginula), or a mere indentation of the margin
(Hemitoma). In Pleurotomaria it is exceptionally long, and is well
marked in Bellerophon, Schismope, Scissurella, Murchisonia, and
Pleurotoma (where it is sutural). In Haliotis and Polytremaria it is
replaced by a series of holes, which are closed up as the animal
grows past them. Some of these holes (at least in Haliotis) certainly
serve the purpose of admitting water to the branchiae, while others
are anal. In Trochotoma there are only two holes, united by a narrow
fissure.
The Tubed Land Operculates.—A group of the Cyclophoridae,
which is restricted to Further India and the great Malay Islands, has
developed a remarkable sutural tube on the exterior of the last whorl,
near the aperture, A similar tube, but more obscure, exists in
Alycaeus. Several stages in the development of this tube may be
noticed, beginning with the elevation of part of the peristome into a
simple irregular shelly plate, which is continued, first into a short, and
then into a long tube, which becomes soldered to the shell; finally,
the tube becomes free, and the anterior part of the last whorl is
disconnected from the spire (Fig. 180 A-D).