SlideShare a Scribd company logo
Visit https://testbankdeal.com to download the full version and
explore more testbank or solutions manual
Database Systems Design Implementation and
Management 11th Edition Coronel Solutions Manual
_____ Click the link below to download _____
https://testbankdeal.com/product/database-systems-design-
implementation-and-management-11th-edition-coronel-
solutions-manual/
Explore and download more testbank or solutions manual at testbankdeal.com
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
Database Systems Design Implementation and Management 11th
Edition Coronel Test Bank
https://testbankdeal.com/product/database-systems-design-
implementation-and-management-11th-edition-coronel-test-bank/
Database Systems Design Implementation and Management 12th
Edition Coronel Solutions Manual
https://testbankdeal.com/product/database-systems-design-
implementation-and-management-12th-edition-coronel-solutions-manual/
Database Systems Design Implementation And Management 13th
Edition Coronel Solutions Manual
https://testbankdeal.com/product/database-systems-design-
implementation-and-management-13th-edition-coronel-solutions-manual/
Business Communication In Person In Print Online 8th
Edition Newman Solutions Manual
https://testbankdeal.com/product/business-communication-in-person-in-
print-online-8th-edition-newman-solutions-manual/
Canadian Fundamentals of Nursing 6th Edition Potter Test
Bank
https://testbankdeal.com/product/canadian-fundamentals-of-nursing-6th-
edition-potter-test-bank/
Implementing Organizational Change 3rd Edition Spector
Solutions Manual
https://testbankdeal.com/product/implementing-organizational-
change-3rd-edition-spector-solutions-manual/
Strategic Human Resources Planning 7th Edition Belcourt
Test Bank
https://testbankdeal.com/product/strategic-human-resources-
planning-7th-edition-belcourt-test-bank/
Visual Anatomy and Physiology Lab Manual Main Version 2nd
Edition Sarikas Solutions Manual
https://testbankdeal.com/product/visual-anatomy-and-physiology-lab-
manual-main-version-2nd-edition-sarikas-solutions-manual/
Evolve Resources for Illustrated Anatomy of the Head and
Neck 5th Edition Fehrenbach Test Bank
https://testbankdeal.com/product/evolve-resources-for-illustrated-
anatomy-of-the-head-and-neck-5th-edition-fehrenbach-test-bank/
Dental Hygiene Applications to Clinical Practice 1st
Edition Henry Test Bank
https://testbankdeal.com/product/dental-hygiene-applications-to-
clinical-practice-1st-edition-henry-test-bank/
Chapter 7 An Introduction to Structured Query Language (SQL)
239
Chapter 7
Introduction to Structured Query Language (SQL)
NOTE
Several points are worth emphasizing:
• We have provided the SQL scripts for both chapters 7 and 8. These scripts are intended to
facilitate the flow of the material presented to the class. However, given the comments made
by our students, the scripts should not replace the manual typing of the SQL commands by
students. Some students learn SQL better when they have a chance to type their own
commands and get the feedback provided by their errors. We recommend that the students use
their lab time to practice the commands manually.
• Because this chapter focuses on learning SQL, we recommend that you use the Microsoft
Access SQL window to type SQL queries. Using this approach, you will be able to
demonstrate the interoperability of standard SQL. For example, you can cut and paste the same
SQL command from the SQL query window in Microsoft Access, to Oracle SQL * Plus and to
MS SQL Query Analyzer. This approach achieves two objectives:
➢ It demonstrates that adhering to the SQL standard means that most of the SQL code
will be portable among DBMSes.
➢ It also demonstrates that even a widely accepted SQL standard is sometimes
implemented with slight distinctions by different vendors. For example, the treatment
of date formats in Microsoft Access and Oracle is slightly different.
Answers to Review Questions
1. In a SELECT query, what is the difference between a WHERE clause and a HAVING clause?
Both a WHERE clause and a HAVING clause can be used to eliminate rows from the results of a
query. The differences are 1) the WHERE clause eliminates rows before any grouping for aggregate
functions occurs while the HAVING clause eliminates groups after the grouping has been done, and
2) the WHERE clause cannot contain an aggregate function but the HAVING clause can.
2. Explain why the following command would create an error, and what changes could be made
to fix the error.
SELECT V_CODE, SUM(P_QOH) FROM PRODUCT;
The command would generate an error because an aggregate function is applied to the P_QOH
attribute but V_CODE is neither in an aggregate function or in a GROUP BY. This can be fixed by
either 1) placing V_CODE in an appropriate aggregate function based on the data that is being
requested by the user, 2) adding a GROUP BY clause to group by values of V_CODE (i.e. GROUP
BY V_CODE), 3) removing the V_CODE attribute from the SELECT clause, or 4) removing the
Sum aggregate function from P_QOH. Which of these solutions is most appropriate depends on the
question that the query was intended to answer.
Chapter 7 An Introduction to Structured Query Language (SQL)
240
3. What type of integrity is enforced when a primary key is declared?
Creating a primary key constraint enforces entity integrity (i.e. no part of the primary key can
contain a null and the primary key values must be unique).
4. Explain why it might be more appropriate to declare an attribute that contains only digits as a
character data type instead of a numeric data type.
An attribute that contains only digits may be properly defined as character data when the values are
nominal; that is, the values do not have numerical significance but serve only as labels such as ZIP
codes and telephone numbers. One easy test is to consider whether or not a leading zero should be
retained. For the ZIP code 03133, the leading zero should be retained; therefore, it is appropriate to
define it as character data. For the quantity on hand of 120, we would not expect to retain a leading
zero such as 0120; therefore, it is appropriate to define the quantity on hand as a numeric data type.
5. What is the difference between a column constraint and a table constraint?
A column constraint can refer to only the attribute with which it is specified. A table constraint can
refer to any attributes in the table.
6. What are “referential constraint actions”?
Referential constraint actions, such as ON DELETE CASCADE, are default actions that the DBMS
should take when a DML command would result in a referential integrity constraint violation.
Without referential constraint actions, DML commands that would result in a violation of referential
integrity will fail with an error indicating that the referential integrity constrain cannot be violated.
Referential constraint actions can allow the DML command to successfully complete while making
the designated changes to the related records to maintain referential integrity.
7. Rewrite the following WHERE clause without the use of the IN special operator.
WHERE V_STATE IN (‘TN’, ‘FL’, ‘GA’)
WHERE V_STATE = 'TN' OR V_STATE = 'FL' OR V_STATE = 'GA'
Notice that each criteria must be complete (i.e. attribute-operator-value).
8. Explain the difference between an ORDER BY clause and a GROUP BY clause.
An ORDER BY clause has no impact on which rows are returned by the query, it simply sorts those
rows into the specified order. A GROUP BY clause does impact the rows that are returned by the
query. A GROUP BY clause gathers rows into collections that can be acted on by aggregate
functions.
9. Explain why the two following commands produce different results.
SELECT DISTINCT COUNT (V_CODE) FROM PRODUCT;
Chapter 7 An Introduction to Structured Query Language (SQL)
241
SELECT COUNT (DISTINCT V_CODE) FROM PRODUCT;
The difference is in the order of operations. The first command executes the Count function to count
the number of values in V_CODE (say the count returns "14" for example) including duplicate
values, and then the Distinct keyword only allows one count of that value to be displayed (only one
row with the value "14" appears as the result). The second command applies the Distinct keyword to
the V_CODEs before the count is taken so only unique values are counted.
10. What is the difference between the COUNT aggregate function and the SUM aggregate
function?
COUNT returns the number of values without regard to what the values are. SUM adds the values
together and can only be applied to numeric values.
11. Explain why it would be preferable to use a DATE data type to store date data instead of a
character data type.
The DATE data type uses numeric values based on the Julian calendar to store dates. This makes
date arithmetic such as adding and subtracting days or fractions of days possible (as well as
numerous special date-oriented functions discussed in the next chapter!).
12. What is a recursive join?
A recursive join is a join in which a table is joined to itself.
Problem Solutions
O n l i n e C o n t e n t
Problems 1 – 25 are based on the Ch07_ConstructCo database located www.cengagebrain.com. This database
is stored in Microsoft Access format. The website provides Oracle, MySQL, and MS SQL Server script files.
The Ch07_ConstructCo database stores data for a consulting company that tracks all charges to
projects. The charges are based on the hours each employee works on each project. The structure and
contents of the Ch07_ConstructCo database are shown in Figure P7.1.
Figure P7.1 Structure and contents of the Ch07_ConstructCo database
Chapter 7 An Introduction to Structured Query Language (SQL)
242
Note that the ASSIGNMENT table in Figure P7.1 stores the JOB_CHG_HOUR values as an
attribute (ASSIGN_CHG_HR) to maintain historical accuracy of the data. The
JOB_CHG_HOUR values are likely to change over time. In fact, a JOB_CHG_HOUR change will
be reflected in the ASSIGNMENT table. And, naturally, the employee primary job assignment
might change, so the ASSIGN_JOB is also stored. Because those attributes are required to
maintain the historical accuracy of the data, they are not redundant.
Given the structure and contents of the Ch07_ConstructCo database shown in Figure P7.1, use
SQL commands to answer Problems 1–25.
1. Write the SQL code that will create the table structure for a table named EMP_1. This table is
a subset of the EMPLOYEE table. The basic EMP_1 table structure is summarized in the table
below. (Note that the JOB_CODE is the FK to JOB.)
Chapter 7 An Introduction to Structured Query Language (SQL)
243
ATTRIBUTE (FIELD) NAME DATA DECLARATION
EMP_NUM CHAR(3)
EMP_LNAME VARCHAR(15)
EMP_FNAME VARCHAR(15)
EMP_INITIAL CHAR(1)
EMP_HIREDATE DATE
JOB_CODE CHAR(3)
CREATE TABLE EMP_1 (
EMP_NUM CHAR(3) PRIMARY KEY,
EMP_LNAME VARCHAR(15) NOT NULL,
EMP_FNAME VARCHAR(15) NOT NULL,
EMP_INITIAL CHAR(1),
EMP_HIREDATE DATE,
JOB_CODE CHAR(3),
FOREIGN KEY (JOB_CODE) REFERENCES JOB);
NOTE
We have already provided the EMP_1 table for you. If you try to run the preceding query,
you will get an error message because the EMP_1 table already exits.
2. Having created the table structure in Problem 1, write the SQL code to enter the first two rows
for the table shown in Figure P7.2.
Figure P7.2 The contents of the EMP_1 table
INSERT INTO EMP_1 VALUES (‘101’, ‘News’, ‘John’, ‘G’, ’08-Nov-00’, ‘502’);
INSERT INTO EMP_1 VALUES (‘102’, ‘Senior’, ‘David’, ‘H’, ’12-Jul-89’, ‘501’);
3. Assuming the data shown in the EMP_1 table have been entered, write the SQL code that will
list all attributes for a job code of 502.
SELECT *
FROM EMP_1
WHERE JOB_CODE = ‘502’;
Chapter 7 An Introduction to Structured Query Language (SQL)
244
4. Write the SQL code that will save the changes made to the EMP_1 table.
COMMIT;
5. Write the SQL code to change the job code to 501 for the person whose employee number
(EMP_NUM) is 107. After you have completed the task, examine the results, and then reset the
job code to its original value.
UPDATE EMP_1
SET JOB_CODE = ‘501’
WHERE EMP_NUM = ‘107’;
To see the changes:
SELECT *
FROM EMP_1
WHERE EMP_NUM = ‘107’;
To reset, use
ROLLBACK;
6. Write the SQL code to delete the row for the person named William Smithfield, who was hired
on June 22, 2004, and whose job code classification is 500. (Hint: Use logical operators to
include all of the information given in this problem.)
DELETE FROM EMP_1
WHERE EMP_LNAME = 'Smithfield'
AND EMP_FNAME = 'William'
AND EMP_HIREDATE = '22-June-04'
AND JOB_CODE = '500';
7. Write the SQL code that will restore the data to its original status; that is, the table should
contain the data that existed before you made the changes in Problems 5 and 6.
ROLLBACK;
Chapter 7 An Introduction to Structured Query Language (SQL)
245
8. Write the SQL code to create a copy of EMP_1, naming the copy EMP_2. Then write the SQL
code that will add the attributes EMP_PCT and PROJ_NUM to its structure. The EMP_PCT
is the bonus percentage to be paid to each employee. The new attribute characteristics are:
EMP_PCTNUMBER(4,2)
PROJ_NUMCHAR(3)
(Note: If your SQL implementation allows it, you may use DECIMAL(4,2) rather than
NUMBER(4,2).)
There are two way to get this job done. The two possible solutions are shown next.
Solution A:
CREATE TABLE EMP_2 (
EMP_NUM CHAR(3) NOT NULL UNIQUE,
EMP_LNAME VARCHAR(15) NOT NULL,
EMP_FNAME VARCHAR(15) NOT NULL,
EMP_INITIAL CHAR(1),
EMP_HIREDATE DATE NOT NULL,
JOB_CODE CHAR(3) NOT NULL,
PRIMARY KEY (EMP_NUM),
FOREIGN KEY (JOB_CODE) REFERENCES JOB);
INSERT INTO EMP_2 SELECT * FROM EMP_1;
ALTER TABLE EMP_2
ADD (EMP_PCT NUMBER (4,2)),
ADD (PROJ_NUM CHAR(3));
Solution B:
CREATE TABLE EMP_2 AS SELECT * FROM EMP_1;
ALTER TABLE EMP_2
ADD (EMP_PCT NUMBER (4,2)),
ADD (PROJ_NUM CHAR(3));
9. Write the SQL code to change the EMP_PCT value to 3.85 for the person whose employee
number (EMP_NUM) is 103. Next, write the SQL command sequences to change the
EMP_PCT values as shown in Figure P7.9.
Chapter 7 An Introduction to Structured Query Language (SQL)
246
Figure P7.9 The contents of the EMP_2 table
UPDATE EMP_2
SET EMP_PCT = 3.85
WHERE EMP_NUM = '103';
To enter the remaining EMP_PCT values, use the following SQL statements:
UPDATEEMP_2
SET EMP_PCT = 5.00
WHERE EMP_NUM = ‘101’;
UPDATEEMP_2
SET EMP_PCT = 8.00
WHERE EMP_NUM = ‘102’;
Follow this format for the remaining rows.
10. Using a single command sequence, write the SQL code that will change the project number
(PROJ_NUM) to 18 for all employees whose job classification (JOB_CODE) is 500.
UPDATE EMP_2
SET PROJ_NUM = '18'
WHERE JOB_CODE = '500';
11. Using a single command sequence, write the SQL code that will change the project number
(PROJ_NUM) to 25 for all employees whose job classification (JOB_CODE) is 502 or higher.
When you finish Problems 10 and 11, the EMP_2 table will contain the data shown in Figure
P7.11. (You may assume that the table has been saved again at this point.)
Chapter 7 An Introduction to Structured Query Language (SQL)
247
Figure P7.11 The EMP_2 table contents after the modification
UPDATE EMP_2
SET PROJ_NUM = '25'
WHERE JOB_CODE > = '502'
12. Write the SQL code that will change the PROJ_NUM to 14 for those employees who were
hired before January 1, 1994 and whose job code is at least 501. (You may assume that the
table will be restored to its condition preceding this question.)
UPDATE EMP_2
SET PROJ_NUM = '14'
WHERE EMP_HIREDATE <= ' 01-Jan-94'
AND JOB_CODE >= '501';
13. Write the two SQL command sequences required to:
There are many ways to accomplish both tasks. We are illustrating the shortest way to do the job
next.
a. Create a temporary table named TEMP_1 whose structure is composed of the EMP_2
attributes EMP_NUM and EMP_PCT.
The SQL code shown in problem 13b contains the solution for problem 13a.
b. Copy the matching EMP_2 values into the TEMP_1 table.
CREATE TABLE TEMP_1 AS SELECT EMP_NUM, EMP_PCT FROM EMP_2;
An alternate way would be to create the table and then, use an INSERT with a sub-select to
populate the rows.
CREATE TABLE TEMP_1 AS (
EMP_NUM CHAR(3),
EMP_PCT NUMBER(4,2));
INSERT INTO TEMP_1
SELECT EMP_NUM, EMP_PCT FROM EMP_2;
Chapter 7 An Introduction to Structured Query Language (SQL)
248
14. Write the SQL command that will delete the newly created TEMP_1 table from the database.
DROP TABLE TEMP_1;
15. Write the SQL code required to list all employees whose last names start with Smith. In other
words, the rows for both Smith and Smithfield should be included in the listing. Assume case
sensitivity.
SELECT *
FROM EMP_2
WHERE EMP_LNAME LIKE 'Smith%';
16. Using the EMPLOYEE, JOB, and PROJECT tables in the Ch07_ConstructCo database (see
Figure P7.1), write the SQL code that will produce the results shown in Figure P7.16.
Figure P7.16 The query results for Problem 16
SELECT PROJ_NAME, PROJ_VALUE, PROJ_BALANCE, EMPLOYEE.EMP_LNAME,
EMP_FNAME, EMP_INITIAL, EMPLOYEE.JOB_CODE, JOB.JOB_DESCRIPTION,
JOB.JOB_CHG_HOUR
FROM PROJECT, EMPLOYEE, JOB
WHERE EMPLOYEE.EMP_NUM = PROJECT.EMP_NUM
AND JOB.JOB_CODE = EMPLOYEE.JOB_CODE;
17. Write the SQL code that will produce a virtual table named REP_1. The virtual table should
contain the same information that was shown in Problem 16.
CREATE VIEW REP_1 AS
SELECT PROJ_NAME, PROJ_VALUE, PROJ_BALANCE, EMPLOYEE.EMP_LNAME,
EMP_FNAME, EMP_INITIAL, EMPLOYEE.JOB_CODE, JOB.JOB_DESCRIPTION,
JOB.JOB_CHG_HOUR
FROM PROJECT, EMPLOYEE, JOB
WHERE EMPLOYEE.EMP_NUM = PROJECT.EMP_NUM
AND JOB.JOB_CODE = EMPLOYEE.JOB_CODE;
Chapter 7 An Introduction to Structured Query Language (SQL)
249
18. Write the SQL code to find the average bonus percentage in the EMP_2 table you created in
Problem 8.
SELECT AVG(EMP_PCT)
FROM EMP_2;
19. Write the SQL code that will produce a listing for the data in the EMP_2 table in ascending
order by the bonus percentage.
SELECT *
FROM EMP_2
ORDER BY EMP_PCT;
20. Write the SQL code that will list only the distinct project numbers found in the EMP_2 table.
SELECT DISTINTC PROJ_NUM
FROM EMP_2;
21. Write the SQL code to calculate the ASSIGN_CHARGE values in the ASSIGNMENT table in
the Ch07_ConstructCo database. (See Figure P7.1.) Note that ASSIGN_CHARGE is a derived
attribute that is calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS.
UPDATE ASSIGNMENT
SET ASSIGN_CHARGE = ASSIGN_CHG_HR * ASSIGN_HOURS;
22. Using the data in the ASSIGNMENT table, write the SQL code that will yield the total number
of hours worked for each employee and the total charges stemming from those hours worked.
The results of running that query are shown in Figure P7.22.
Figure P7.22 Total hours and charges by employee
Chapter 7 An Introduction to Structured Query Language (SQL)
250
SELECT ASSIGNMENT.EMP_NUM, EMPLOYEE.EMP_LNAME,
Sum(ASSIGNMENT.ASSIGN_HOURS) AS SumOfASSIGN_HOURS,
Sum(ASSIGNMENT.ASSIGN_CHARGE) AS SumOfASSIGN_CHARGE
FROM EMPLOYEE, ASSIGNMENT
WHERE EMPLOYEE.EMP_NUM = ASSIGNMENT.EMP_NUM
GROUP BY ASSIGNMENT.EMP_NUM, EMPLOYEE.EMP_LNAME;
23. Write a query to produce the total number of hours and charges for each of the projects
represented in the ASSIGNMENT table. The output is shown in Figure P7.23.
Figure P7.23 Total hour and charges by project
SELECT ASSIGNMENT.PROJ_NUM,
Sum(ASSIGNMENT.ASSIGN_HOURS) AS SumOfASSIGN_HOURS,
Sum(ASSIGNMENT.ASSIGN_CHARGE) AS SumOfASSIGN_CHARGE
FROM ASSIGNMENT
GROUP BY ASSIGNMENT.PROJ_NUM
24. Write the SQL code to generate the total hours worked and the total charges made by all
employees. The results are shown in Figure P7.24. (Hint: This is a nested query. If you use
Microsoft Access, you can generate the result by using the query output shown in Figure P7.22
as the basis for the query that will produce the output shown in Figure P7.24.)
Figure P7.24 Total hours and charges, all employees
Solution A:
SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS,
Sum(SumOfASSIGN_CHARGE) AS SumOfASSIGN_CHARGE
FROM Q23;
or
Chapter 7 An Introduction to Structured Query Language (SQL)
251
SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS,
Sum(SumOfASSIGN_CHARGE as SumOfASSIGN_CHARGE
FROM (SELECT ASSIGNMENT.PROJ_NUM,
Sum(ASSIGNMENT.ASSIGN_HOURS) AS SumOfASSIGN_HOURS,
Sum(ASSIGNMENT.ASSIGN_CHARGE) AS
SumOfASSIGN_CHARGE
FROM ASSIGNMENT
GROUP BY ASSIGNMENT.PROJ_NUM
);
Solution B:
SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS,
Sum(SumOfASSIGN_CHARGE) AS SumOfASSIGN_CHARGE
FROM Q22;
or
SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS,
Sum(SumOfASSIGN_CHARGE) AS SumOfASSIGN_CHARGE
FROM (SELECT ASSIGNMENT.EMP_NUM, EMPLOYEE.EMP_LNAME,
Sum(ASSIGNMENT.ASSIGN_HOURS) AS SumOfASSIGN_HOURS,
Sum(ASSIGNMENT.ASSIGN_CHARGE) AS
SumOfASSIGN_CHARGE
FROM EMPLOYEE, ASSIGNMENT
WHERE EMPLOYEE.EMP_NUM = ASSIGNMENT.EMP_NUM
GROUP BY ASSIGNMENT.EMP_NUM, EMPLOYEE.EMP_LNAME
);
Chapter 7 An Introduction to Structured Query Language (SQL)
252
25. Write the SQL code to generate the total hours worked and the total charges made to all
projects. The results should be the same as those shown in Figure P7.24. (Hint: This is a nested
query. If you use Microsoft Access, you can generate the result by using the query output
shown in Figure P7.23 as the basis for this query.)
SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS,
Sum(SumOfASSIGN_CHARGE) AS SumOfASSIGN_CHARGE
FROM Q23;
or
SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS,
Sum(SumOfASSIGN_CHARGE as SumOfASSIGN_CHARGE
FROM (SELECT ASSIGNMENT.PROJ_NUM,
Sum(ASSIGNMENT.ASSIGN_HOURS) AS SumOfASSIGN_HOURS,
Sum(ASSIGNMENT.ASSIGN_CHARGE) AS
SumOfASSIGN_CHARGE
FROM ASSIGNMENT
GROUP BY ASSIGNMENT.PROJ_NUM
);
O n l i n e C o n t e n t
Problems 26−43 are based on the Ch07_SaleCo database, which is available at www.cengagebrain.com.
This database is stored in Microsoft Access format. Oracle, MySQL and MS SQL Server script files are
available at www.cengagebrain.com.
The structure and contents of the Ch07_SaleCo database are shown in Figure P7.26. Use this
database to answer the following problems. Save each query as QXX, where XX is the problem
number.
26. Write a query to count the number of invoices.
SELECT COUNT(*) FROM INVOICE;
27. Write a query to count the number of customers with a customer balance over $500.
SELECT COUNT(*)
FROM CUSTOMER
WHERE CUS_BALANCE >500;
Chapter 7 An Introduction to Structured Query Language (SQL)
253
28. Generate a listing of all purchases made by the customers, using the output shown in Figure
P7.28 as your guide. (Hint: Use the ORDER BY clause to order the resulting rows as shown in
Figure P7.28)
FIGURE P7.28 List of Customer Purchases
SELECT INVOICE.CUS_CODE, INVOICE.INV_NUMBER, INVOICE.INV_DATE,
PRODUCT.P_DESCRIPT, LINE.LINE_UNITS, LINE.LINE_PRICE
FROM CUSTOMER, INVOICE, LINE, PRODUCT
WHERE CUSTOMER.CUS_CODE = INVOICE.CUS_CODE
AND INVOICE.INV_NUMBER = LINE.INV_NUMBER
AND PRODUCT.P_CODE = LINE.P_CODE
ORDER BY INVOICE.CUS_CODE, INVOICE.INV_NUMBER, PRODUCT.P_DESCRIPT;
Chapter 7 An Introduction to Structured Query Language (SQL)
254
29. Using the output shown in Figure P7.29 as your guide, generate the listing of customer
purchases, including the subtotals for each of the invoice line numbers. (Hint: Modify the
query format used to produce the listing of customer purchases in Problem 18, delete the
INV_DATE column, and add the derived (computed) attribute LINE_UNITS * LINE_PRICE
to calculate the subtotals.)
FIGURE P7.29 Summary of Customer Purchases with Subtotals
SELECT INVOICE.CUS_CODE, INVOICE.INV_NUMBER, PRODUCT.P_DESCRIPT,
LINE.LINE_UNITS AS [Units Bought], LINE.LINE_PRICE AS [Unit Price],
LINE.LINE_UNITS*LINE.LINE_PRICE AS Subtotal
FROM CUSTOMER, INVOICE, LINE, PRODUCT
WHERE CUSTOMER.CUS_CODE = INVOICE.CUS_CODE
AND INVOICE.INV_NUMBER = LINE.INV_NUMBER
AND PRODUCT.P_CODE = LINE.P_CODE
ORDER BY INVOICE.CUS_CODE, INVOICE.INV_NUMBER, PRODUCT.P_DESCRIPT;
Chapter 7 An Introduction to Structured Query Language (SQL)
255
30. Modify the query used in Problem 29 to produce the summary shown in Figure P7.30.
FIGURE P7.30 Customer Purchase Summary
SELECT INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE,
Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Total Purchases]
FROM CUSTOMER, INVOICE, LINE
WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER
AND CUSTOMER.CUS_CODE = INVOICE.CUS_CODE
GROUP BY INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE;
31. Modify the query in Problem 30 to include the number of individual product purchases made
by each customer. (In other words, if the customer’s invoice is based on three products, one
per LINE_NUMBER, you would count three product purchases. If you examine the original
invoice data, you will note that customer 10011 generated three invoices, which contained a
total of six lines, each representing a product purchase.) Your output values must match those
shown in Figure P7.31.
FIGURE P7.31 Customer Total Purchase Amounts and Number of Purchases
SELECT INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE,
Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Total Purchases],
Count(*) AS [Number of Purchases]
FROM CUSTOMER, INVOICE, LINE
WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER
AND CUSTOMER.CUS_CODE = INVOICE.CUS_CODE
GROUP BY INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE;
Chapter 7 An Introduction to Structured Query Language (SQL)
256
32. Use a query to compute the average purchase amount per product made by each customer.
(Hint: Use the results of Problem 31 as the basis for this query.) Your output values must
match those shown in Figure P7.32. Note that the Average Purchase Amount is equal to the
Total Purchases divided by the Number of Purchases.
FIGURE P7.32 Average Purchase Amount by Customer
SELECT INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE,
Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Total Purchases],
Count(*) AS [Number of Purchases],
AVG(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Average Purchase Amount]
FROM CUSTOMER, INVOICE, LINE
WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER
AND CUSTOMER.CUS_CODE = INVOICE.CUS_CODE
GROUP BY INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE;
33. Create a query to produce the total purchase per invoice, generating the results shown in
Figure P7.33. The Invoice Total is the sum of the product purchases in the LINE that
corresponds to the INVOICE.
FIGURE P7.33 Invoice Totals
SELECT LINE.INV_NUMBER,
Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Invoice Total]
FROM LINE
GROUP BY LINE.INV_NUMBER;
Chapter 7 An Introduction to Structured Query Language (SQL)
257
34. Use a query to show the invoices and invoice totals as shown in Figure P7.34. (Hint: Group by
the CUS_CODE.)
FIGURE P7.34 Invoice Totals by Customer
SELECT CUS_CODE, LINE.INV_NUMBER AS INV_NUMVER,
Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Invoice Total]
FROM INVOICE, LINE
WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER
GROUP BY CUS_CODE, LINE.INV_NUMBER;
35. Write a query to produce the number of invoices and the total purchase amounts by customer,
using the output shown in Figure P7.35 as your guide. (Compare this summary to the results
shown in Problem 34.)
FIGURE P7.35 Number of Invoices and Total Purchase Amounts by Customer
Note that a query may be used as the data source for another query. The following code is shown in
qryP7.35A in your Ch07_Saleco database. Note that the data source is qryP6-34.
SELECT CUS_CODE,
Count(INV_NUMBER) AS [Number of Invoices],
AVG([Invoice Total]) AS [Average Invoice Amount],
MAX([Invoice Total]) AS [Max Invoice Amount],
MIN([Invoice Total]) AS [Min Invoice Amount],
Sum([Invoice Total]) AS [Total Customer Purchases]
FROM [qryP7-34]
GROUP BY [qryP7-34].CUS_CODE;
Chapter 7 An Introduction to Structured Query Language (SQL)
258
Instead of using another query as your data source, you can also use an alias. The following code is
shown in Oracle format. You can also find the MS Access “alias” version in qryP7.35B in your
Ch07_SaleCo database.)
SELECT CUS_CODE,
COUNT(LINE.INV_NUMBER) AS [Number of Invoices],
AVG([Invoice Total]) AS [Average Invoice Amount],
MAX([Invoice Total]) AS [Max Invoice Amount],
MIN([Invoice Total]) AS [Min Invoice Amount],
Sum([Invoice Total]) AS [Total Customer Purchases]
FROM (SELECT CUS_CODE, LINE.INV_NUMBER AS INV_NUMBER,
Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Invoice Total]
FROM INVOICE, LINE
WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER
GROUP BY CUS_CODE, LINE.INV_NUMBER)
GROUP BY CUS_CODE;
36. Using the query results in Problem 35 as your basis, write a query to generate the total
number of invoices, the invoice total for all of the invoices, the smallest invoice amount,
the largest invoice amount, and the average of all of the invoices. (Hint: Check the figure
output in Problem 35.) Your output must match Figure P7.36.
FIGURE P7.36 Number of Invoices, Invoice Totals, Minimum, Maximum, and
Average Sales
SELECT Count([qryP7-34].[INV_NUMBER]) AS [Total Invoices],
Sum([qryP7-34].[Invoice Total]) AS [Total Sales],
Min([qryP7-34].[Invoice Total]) AS [Minimum Sale],
Max([qryP7-34].[Invoice Total]) AS [Largest Sale],
Avg([qryP7-34].[Invoice Total]) AS [Average Sale]
FROM [qryP7-34];
Another Random Scribd Document
with Unrelated Content
STATUARY HALL, IN THE CAPITOL
From the rotunda, broad corridors lead north to the Senate
Chamber and south to the House of Representatives. Following the
corridor to the south, we come to a large semicircular room. When
the central division of the building was all there was to the Capitol,
this room was occupied by the House of Representatives, and here
were heard the speeches of Adams, Webster, Clay, Calhoun, and
many other famous statesmen. It is now set apart as a national
statuary hall, where each state may place two statues of her chosen
sons. As many of the states have been glad to honor their great men
in this way, a splendid array of national heroes is gathered in the hall.
Among the Revolutionary heroes we find Washington, Ethan Allen,
and Nathaniel Green. A statue of Fulton, sent by New York, shows
him seated, looking at a model of his steamship. Of all these marble
figures, perhaps none attracts more attention than that of Frances
Elizabeth Willard, the great apostle of temperance, and to the state
of Illinois belongs the distinction of having placed the only statue of a
woman in this great collection.
Leaving Statuary Hall, we go south to the Hall of Representatives.
Here representatives from all the states gather to frame laws for the
entire nation. Seated in the gallery it seems almost as if we were in a
huge schoolroom, for the representatives occupy seats which are
arranged in semicircles, facing a white marble desk upon a high
platform reached by marble steps. This is the desk of the Speaker of
the House. The Speaker's duty is to preserve order and to see that
the business of this branch of Congress is carried on as it should be.
Before delivering a speech, a representative must have the Speaker's
permission. The Speaker is a most important person, for all business
is transacted under his direction. The representatives come from
every state in the Union, and even far-off Hawaii, Alaska, and the
Philippines are allowed to send delegates to this assembly to
represent them in making laws. Think what a serious matter it would
have been to the people of the far West to have the capital of their
nation in the extreme Eastern section of the country if the
development of the railroads, the telegraph, and the telephone had
not made travel and communication so easy that great distances are
no longer obstacles.
THE OPENING OF CONGRESS
But we can pay only a brief visit to the House of Representatives,
for there is another body of lawmakers in the northern end of the
Capitol which we wish to see. Back to the rotunda we go and then
walk along a corridor leading to the northern, or Senate, end of the
Capitol. Each day, for a number of months in the year, an interesting
ceremony takes place in this corridor promptly at noon. Nine dignified
men, clad in long black silk robes, march in solemn procession across
the corridor and enter a stately chamber which, though smaller,
resembles Statuary Hall in shape. These men make up the Supreme
Court of the United States, the highest court of justice in the land.
Often in cases at law a person does not feel that the decision of
one court has been just. He may then have his case examined and
passed upon by a higher court. This is called “appealing,” and some
cases, for good cause, may be appealed from one court to another
until they reach the Supreme Court. Beyond the Supreme Court there
is no appeal. What this court decides must be accepted as final. The
room in which the Supreme Court meets was once used as the
Senate Chamber, and many of the great debates heard in the Senate
before our Civil War were held in this room.
The Senate Chamber of to-day is further down the north corridor.
This room is not unlike the Hall of Representatives in plan and
arrangement, though it is somewhat smaller. Instead of having a
chairman of their own choosing, as is the case in the House, the
Senate is presided over by the vice president of the United States.
This high official, seated upon a raised platform, directs the
proceedings of the Senate just as the Speaker directs those of the
House of Representatives. There seems to be an air of greater
solemnity and dignity in this small group of lawmakers than in the
House of Representatives. It is smaller because each state is entitled
to send but two senators to the Senate, whereas the number of
representatives is governed by the number of inhabitants in the state.
The populous state of New York has thirty-seven representatives and
but two senators, the same number as the little state of Rhode Island
whose population entitles it to only two representatives.
The purpose of having two lawmaking bodies is to provide a
safeguard against hasty and unwise legislation. In the House of
Representatives the most populous states have the greatest
influence, while in the Senate all states are equally represented, and
each state has two votes regardless of its size and population. Since
every proposed law must be agreed to in both the Senate and the
House before it is taken to the president for his approval, each body
acts as a check on the other in lawmaking.
INAUGURAL PARADE ON PENNSYLVANIA AVENUE
Just to the east of the Capitol grounds stands the magnificent
Library of Congress. This wonderful storehouse of books is a
marvelous palace. It covers almost an entire city block, and its
towering gilded dome is visible from almost every part of the city.
Once inside, we could easily believe ourselves in fairyland, so
beautiful are the halls and the staircases of carved marble, so
wonderful the paintings and the decorations. Every available space
upon the walls and ceilings is adorned with pictures, with the names
of the great men of the world, and with beautiful quotations from the
poets and scholars who seem to live again in this magnificent
building which is dedicated to the things they loved.
BOTANICAL GARDENS
In the center of the building, just beneath the gilded dome, is a
rotunda slightly wider than the rotunda of the Capitol, though not so
high. Here are desks for the use of those who wish to consult any
volume of the immense collection of books.
The books are kept in great structures called stacks, 9 stories high
and containing bookshelves which would stretch nearly 44 miles if
placed in one line. Any one of the great collection of 1,300,000
volumes can be sent by machinery from the stacks to the reading
room or to the Capitol. When a member of Congress wants a book
which is in the Library, he need not leave the Capitol, for there is a
tunnel connecting the two buildings through which runs a little car to
carry books.
The Librarian of Congress has charge of the enforcement of the
copyright law. By means of this law an author may secure the
exclusive right to publish a book, paper, or picture for twenty-eight
years. One of the requirements of the copyright law is that the author
must place in the Library of Congress two copies of whatever he has
copyrighted. Hence, on the shelves of this great library may be found
almost every book or paper published in the United States.
Leaving the Library we once more find ourselves upon the great
esplanade east of the Capitol. In the majestic white-marble buildings
to the north and south,—known as the Senate and House office
buildings,—committees of each House of Congress meet to discuss
proposed laws.
Having seen the lawmakers at work in the Capitol, let us visit the
officials whose duty it is to enforce the laws made by Congress.
Chief among these is the president of the United States. His house
is officially known as the Executive Mansion, but nearly everybody
speaks of it as the White House. The first public building erected in
Washington was the White House. It is said that Washington himself
chose the site. He lived to see it built but not occupied, for the capital
was not moved to the District of Columbia until 1800, a year after
Washington's death.
THE WHITE HOUSE FROM THE NORTH
This simple, stately building is a fitting home for the head of a
great republic. In the main building are the living apartments of the
president and his family, and the great rooms used for state
receptions; the largest and handsomest of these is the famous East
Room. Other rooms used on public occasions are known, from the
color of the furnishings and hangings, as the Blue Room, the Green
Room, and the Red Room. There is also the great State Dining Room,
where the president entertains at dinner the important government
officials and foreign representatives.
In the Annex, adjoining the White House on the west, are the
offices of the president and those who assist him in his work. In this
part of the building is the cabinet room, where the president meets
the heads of the various departments to consult with them
concerning questions of national importance.
Across the street from the president's office is the immense granite
building occupied by the three departments of State, War, and Navy.
The secretaries in charge of these departments have their offices
here, together with a small army of clerks.
THE UNITED STATES TREASURY
On the opposite side of the White House from the State, War, and
Navy Building is the National Treasury. The Treasury Building is one
of the finest in the city. To see the splendid colonnade on the east is
alone worth a journey to Washington. From this building all the
money affairs of the United States government are directed.
In the Treasury Building and in the Bureau of Engraving and
Printing one may see the entire process of manufacturing and issuing
paper money. In the Treasury we see new bills exchanged for old,
worn-out bills, which are ground to pieces to destroy forever their
value as money.
BUREAU OF ENGRAVING AND PRINTING, “UNCLE SAM'S
MONEY FACTORY”
But to understand the story of a dollar bill or a bill of any other
value we must visit the Bureau of Engraving and Printing. This
building, which is some distance from the Treasury Building, reminds
us of a large printing office, and that is just what it is. Here we are
shown from room to room where many men and women are at work,
some engraving the plates from which bills are to be printed and
others printing the bills. The paper used is manufactured by a secret
process for United States money, and every sheet is most carefully
counted at every stage of the printing. Altogether the sheets are
counted fifty-two times. Many clerks are employed to keep a careful
account of these sheets, and it is almost impossible for a single bill or
a single piece of paper to be lost or stolen. After the money is printed
it is put into bundles, sealed, and sent in a closely guarded steel
wagon to the Treasury Building, where it is stored in great vaults until
it is issued.
A CIRCLE AND ITS RADIATING AVENUES
At the Treasury we find the officials sending out these crisp new
bills in payment of the debts of the United States or in exchange for
bills which are so tattered and torn that they are no longer useful.
This exchanging of new money for old is a large part of the business
of the Treasury and calls for the greatest care in counting and
keeping records, in order that no mistakes may be made.
After the old bills are counted they are cut in half and the halves
counted separately, to make sure that the first count was correct.
When the exact amount of money has been determined, new bills are
sent out to the owners of the old bills, and the old bills are destroyed.
When we have seen enough of the counting of old money, our
guide takes us down into the cellar of this great building, where we
walk along a narrow passageway with millions of dollars in gold and
silver on either hand. All is carefully secured by massive doors and
locks, and none but trusted officials may enter the vaults themselves.
These gold and silver coins are made in the United States mints in
Philadelphia, Denver, New Orleans, and San Francisco.
You see the paper bill is not real money but a sort of receipt
representing gold and silver money which you can get at any time
from the Treasury. As we peep through the barred doors of the vaults
and see great piles of canvas sacks, it is interesting to know that
some of the silver and gold coins they hold are ours, waiting here
while we carry in our pockets the paper bills which represent them.
In addition to issuing money, the Treasury Department has charge
of collecting all the taxes and duties which furnish the money for the
payment of the expenses of the government.
Washington is a government city. Of its population of over 330,000,
about 36,000 are directly engaged in the various departments of the
government, while most of the other lines of business thrive by
supplying the needs of the government's employees and their
families. Very little manufacturing is done in the District of Columbia,
and such articles as are manufactured are chiefly for local use.
People from almost every country in the world may be seen on the
streets, for almost all civilized nations have ministers or ambassadors
at Washington to represent them in official dealings with the United
States. These foreign representatives occupy fine homes, and during
the winter season many brilliant receptions are given by them as well
as by our own high officials.
CONTINENTAL MEMORIAL HALL
The people of Washington have built fine churches and many
handsome schools, to which all, from the president to the humblest
citizen, send their children. In or near the city are the five universities
of George Washington, Georgetown, Howard University for colored
people, the Catholic University, and the American University, where
graduates from other colleges take advanced work.
ANNEX AND GARDEN OF THE PAN-AMERICAN UNION
The citizens of the District of Columbia do not vote nor do they
make their own laws, as it was feared there might be a disagreement
between Congress and the city government if people voted on local
matters. All laws for the District of Columbia are made by the
Congress of the United States and are carried out by three
commissioners appointed by the president with the consent of the
Senate. Many inhabitants of the District are citizens of the states and
go to their homes at election time to cast their votes. Isn't it strange
that there is a place in the United States where the citizens cannot
vote?
UNION STATION
You are, no doubt, beginning to think that the places of interest in
Washington must be very numerous. This is true, for few cities in the
world have so many interesting public buildings. Among these are the
Corcoran Art Gallery; the Continental Memorial Hall, the majestic
marble building of the Daughters of the American Revolution; and the
palatial home of the Pan-American Union, a place where
representatives of all the American republics may meet. Then there is
the Patent Office, for recording and filing old patents and granting
new ones; the Pension Office, from which our war veterans receive a
certain sum each year; the Government Printing Office, whose
reports require over a million dollars' worth of paper each year;
Ford's Theater, where President Lincoln was shot; the naval-gun
factory, for making the fourteen-inch long-range guns used on our
battleships; and the Union Railroad Station, whose east wing is
reserved for the use of the president.
There is one almost sacred spot, upon which the nation has
erected a splendid memorial to our greatest hero, George
Washington. The Washington Monument is a simple obelisk of white
marble, that towers 555 feet above the beautiful park in the midst of
which it stands. Those openings near the top which seem so small
are 504 feet above us and are actually large windows. On entering
WASHINGTON MONUMENT FROM
CONTINENTAL MEMORIAL HALL
the door at the base of the
monument, we pass
through the wall, which is
15 feet thick, and find an
elevator ready to carry us
to the top. If we prefer to
walk, there is an interior
stairway of 900 steps
leading to the top landing.
At the end of our upward
journey we find ourselves
in a large room with two
great windows on each of
the four sides. From here
we get another view of the
hill-surrounded city, and the
scene which lies before us
is inspiring.
The Washington
Monument is near the
western end of the Mall,
that series of parks extending from the Capitol to the Potomac River.
Near by are the buildings of the Department of Agriculture, which has
been of the greatest help to the farmers of our land by sending out
important information concerning almost everything connected with
farm life. Through the Bureau of Chemistry this department did much
to bring about the passage of the Pure Food Law, which protects the
people by forbidding the sale of food and drugs that are not pure.
In the spacious park adjoining the grounds of the Department of
Agriculture is a building which looks like an ancient castle. This is the
Smithsonian Institution, which carries on scientific work under
government control.
The National Museum, which is under the control of the
Smithsonian Institution, has a fine building of its own. This museum
is a perfect treasure house of interesting exhibits of all kinds. Here
may be seen relics of Washington, of General Grant, and of other
famous Americans; and here are exhibits showing the history of the
telegraph, the telephone, the sewing machine, the automobile, and
the flying machine. Stuffed animals of all kinds are arranged to look
just as if they were alive. So numerous are the exhibits that it would
require a large book simply to mention them. Many of the boys and
girls of Washington spend their Saturday afternoons examining the
wonderful things which have been brought to this museum from all
parts of the world.
THE CITY FROM ARLINGTON HEIGHTS
Washington has also a zoölogical park where there are animals
from everywhere. It is on the banks of a beautiful stream on the
outskirts of the city and is part of a great public park which covers
many acres of picturesque wooded country.
We must not omit the Post Office Department, for that is the part
of the federal government which comes nearest to our homes. Here
are the offices of the postmaster general and his many assistants. To
tell of the wonders of our postal system would be a long story in
itself. If all the people employed by the Post Office Department lived
in Washington, they would fill all of the houses and leave no room for
anyone else. Of course this great army of employees are not all in
any one city, for the work of the post office extends to every part of
the United States, and, through arrangement with other nations, to
every part of the civilized world.
In the country surrounding the city of Washington are several
important and interesting places. Just across the river, in the state of
Virginia, are Fort Myer, an army post, and the famous Arlington
National Cemetery. Arlington was the home of Martha Custis, who
became the bride of George Washington. At the opening of the Civil
War it was the home of the famous Confederate general, Robert E.
Lee. Then it passed into the hands of the United States government
and is now the burial place of over sixteen thousand soldiers who
gave their lives for their country.
On the Virginia shore of the Potomac River, sixteen miles south of
the city of Washington, is Mount Vernon, the home and burial place
of George Washington. The spacious old mansion in the midst of fine
trees and shady lawns looks out over the wide peaceful river which
Washington loved. To this home Washington came to live shortly
after his marriage. He spent his time in farming on this estate until he
was called to take command of the American army. After our
independence was won he returned to his home and his farm. Once
more he was called upon to leave this quiet country life to become
the first president of the new nation. When he had served his country
two terms he gladly retired to Mount Vernon, where he lived until his
death in 1799.
WASHINGTON'S TOMB
To-day the house and grounds are preserved with loving care. The
rooms of the house are furnished with fine old mahogany furniture,
many pieces of which belonged to Washington. In the grounds, not
far from the stately mansion, is the simple brick tomb where rest the
bodies of Washington and his wife. During the years which have
passed since his death, thousands of his countrymen have come to
this tomb to do honor to his memory.
As we sail up the Potomac toward the city after our visit to the
home of the great man whose name it bears, the Washington
Monument, the White House, the State, War, and Navy Building, the
Capitol, the Library, and the post office tower above the surrounding
buildings and, shining in the golden light of sunset, make a picture
never to be forgotten.
This city of parks, of broad avenues, of beautiful buildings, belongs
to the Americans who live in the far-distant states as well as to those
who live and work in the capital itself. It is our capital and we may
justly be proud of it, for it is one of the most beautiful cities in all the
world.
WASHINGTON
FACTS TO REMEMBER
The capital of the nation.
Population (1910), nearly 350,000 (331,069).
Sixteenth city in rank, according to population.
Center of the federal government of the United States.
Governed entirely by Congress under provision of the Constitution.
Chief offices of every department of the federal government
located here.
Splendid streets, avenues, parks, and monuments.
Many magnificent public buildings.
Very few manufacturing industries.
A city of homes of government employees.
One of the most interesting and beautiful cities in the world.
QUESTIONS FOR REVIEW AND STUDY
1. Give some reasons why every citizen of the United States should
be interested in Washington.
2. What interesting buildings are located here, and for what are
they used?
3. What were some of the reasons for selecting the location of the
capital city?
4. After whom was the city named?
5. In what year did Washington become the capital city, and what
disaster visited it a few years later?
6. Describe the plan of the city, and name one of its famous
streets.
7. Name three interesting groups of buildings: one on Capitol Hill,
one on Pennsylvania Avenue, and one in the Mall.
8. What are some of the natural beauties of the city?
9. Give some idea of the size and beauty of the Capitol and of the
imposing ceremony which takes place there every four years.
10. Describe briefly the House of Representatives when in session
and the duties of its members.
11. Where does the Supreme Court of the country sit, and why is it
called the Supreme Court?
12. How does the Senate differ from the House of Representatives?
What are the duties of senators? How many come from each state?
13. Why do we have two lawmaking bodies?
14. Name some of the attractions of the Library of Congress. Tell
how its books are stacked and how they are sent to the Capitol, and
give some facts about the copyright law.
15. Tell what you know of the White House.
16. What two fine buildings are on either side of the White House,
and for what is each used?
17. Describe the making of paper money.
18. What are the duties of the Treasury Department, and what may
be seen in the Treasury vaults?
19. Tell something about the people of Washington, their chief
occupation, and why so many foreign diplomats have their homes
here.
20. How are the city of Washington and the District of Columbia
governed?
21. Name some places of interest in Washington not already
mentioned.
22. Describe the splendid monument by which our greatest hero is
honored.
23. Tell why you would like to visit the Smithsonian Institution, the
National Museum, and the Zoölogical Park.
24. Why are Fort Myer, Arlington, and Mount Vernon very
interesting to all citizens of the United States?
25. To whom does the beautiful city of Washington really belong,
and why should we be proud of it?
REFERENCE TABLES
LARGEST CITIES OF THE WORLD ACCORDING TO
POPULATION
Rank
London 1
New York 2
Paris 3
Chicago 4
Berlin 5
Tokio 6
Vienna 7
Petrograd 8
Philadelphia 9
Moscow 10
Buenos Ayres 11
Constantinople 12
INCREASE IN POPULATION OF OUR GREAT CITIES—
NATIONAL CENSUS
City
Population Rank
1910 1900 1890 1910 19001890
New York 4,766,883 3,437,202 1,515,301 1 1 1
Chicago 2,185,283 1,698,575 1,099,850 2 2 2
Philadelphia 1,549,008 1,293,697 1,046,964 3 3 3
St. Louis 687,029 575,238 451,770 4 4 5
Boston 670,585 560,892 448,477 5 5 6
Cleveland 560,663 381,768 261,353 6 7 10
Baltimore 558,485 508,957 434,439 7 6 7
Pittsburgh 533,905 321,616 238,617 8 11 13
Detroit 465,766 285,704 205,876 9 13 15
Buffalo 423,715 352,387 255,664 10 8 11
San Francisco 416,912 342,782 298,997 11 9 8
Milwaukee 373,857 285,315 204,468 12 14 16
Cincinnati 363,591 325,902 296,908 13 10 9
Newark 347,469 246,070 181,830 14 16 17
New Orleans 339,075 287,104 242,039 15 12 12
Washington 331,069 278,718 230,392 16 15 14
THE FOREIGN-BORN POPULATION OF OUR GREAT CITIES
City
Leading Countries of Birth of
Foreign-Born Population—1910
First Second
Baltimore Germany Russia
Boston Ireland Canada
Buffalo Germany Canada
Chicago Germany Austria
Cincinnati Germany Hungary
Cleveland Austria Germany
Detroit Germany Canada
Jersey City Germany Ireland
Los Angeles Germany Canada
Milwaukee Germany Russia
Minneapolis Sweden Norway
New Orleans Italy Germany
New York Russia Italy
Newark Germany Russia
Philadelphia Russia Ireland
Pittsburgh Germany Russia
St. Louis Germany Russia
San Francisco Germany Ireland
Washington Ireland Germany
SHORTEST RAILWAY TRAVEL—DISTANCE FROM NEW YORK
CITY
San Francisco 3182 miles
New Orleans 1344 miles
St. Louis 1059 miles
Chicago 908 miles
Detroit 690 miles
Cleveland 576 miles
Pittsburgh 441 miles
Buffalo 439 miles
Boston 235 miles
Washington, D.C. 226 miles
Baltimore 186 miles
Philadelphia 92 miles
SHORTEST RAILWAY TRAVEL—DISTANCE FROM CHICAGO
San Francisco 2274 miles
Boston 1021 miles
New Orleans 923 miles
New York 908 miles
Philadelphia 818 miles
Baltimore 797 miles
Washington, D.C. 787 miles
Buffalo 523 miles
Pittsburgh 468 miles
Cleveland 339 miles
St. Louis 286 miles
Detroit 272 miles
TO WHOM WE SELL THE MOST
The Amount for 1914
Great Britain $594,271,863
Germany $344,794,276
Canada $344,716,981
France $159,818,924
Netherlands $112,215,673
Italy $74,235,012
Cuba $68,884,428
Belgium $61,219,894
Japan $51,205,520
Argentina $45,179,089
Mexico $38,748,793
FROM WHOM WE BUY THE MOST
The Amount for 1914
Great Britain $293,661,304
Germany $189,919,136
Canada $160,689,709
France $141,446,252
Cuba $131,303,794
Japan $107,355,897
Brazil $101,303,794
Mexico $92,690,566
British India $73,630,880
Italy $56,407,671
SOME OF THE GREAT RAILROADS OF THE UNITED STATES
INDEX
Abbey, Edwin A., 128
Adams, John, 84, 87
Adams, Samuel, 124
Alameda, 240
Allegheny, 182, 184
Allegheny River, 171, 172, 182
Baldwin, Matthias W., 71
Baldwin Locomotive Works, 71
Baltimore, 155–170
railroad center, 155
harbor, 155
industries, 155, 156
exports, 155
fire of 1904, 156
public markets, 160
settlement of, 167
Baltimore, Lord, 168
Barge canal, 212
Belleville, 98
Berkeley, 240
Bienville, Governor, 245
Blackstone, William, 105
Boston, 105–136
capital of Massachusetts, 105
settlement of, 105
divisions of, 107
harbor, 108
trade center, 119
foreign commerce, 121
industries, 121
Boston Tea Party, 84, 122
Braddock, 173
Bradford, William, 73
Brockton, 119
Brooklyn, 11, 24, 28, 30
Brooks, Phillips, 127
Bruceton, 178
Buffalo, 207–226
settlement of, 207, 208
named, 209
Erie Canal, 210
lake port, 211
importance of location, 212
trade with Canada, 212
manufacturing center, 213
Niagara power, 213, 216, 224–225
iron industry, 214
flour mills, 216
important live-stock market, 217
important lumber market, 217
harbor, 221
Buffalo River, 207, 221
Bulfinch, Charles, 111
Cadillac, Antoine de la Mothe, 191
Calumet River, 56
Cambridge, 116, 117, 131, 133
Carnegie, Andrew, 184
Carnegie Steel Company, 175
Centennial Exhibition, 75
Charles River, 116
Chicago, 41–66, 180
fire of 1871, 41
settlement of, 43
harbor, 45, 56, 57
becomes a city, 46
important railroad center, 54
greatest lake port, 54
grain market, 55
steel industry, 56
largest lumber market, 57
exports, 57
center of packing industry, 61
Pullman, 62
Chicago drainage and ship canal, 54
Chicago River, 41, 43, 45, 53, 54, 57
Civil War, 247
Cleaveland, General Moses, 137
Cleveland, 137–154, 180
settlement of, 137
harbor, 141
becomes a city, 142
industries, 142, 143, 148
importance of location, 148
manufacturing center, 148
largest ore market in the world, 148
center of shipbuilding, 148
important lake port, 153
Cleveland, Grover, 224
Clinton, De Witt, 209
Coal, 56, 70, 100, 142, 172, 175, 213, 214, 215, 257
Coal mines, 175
Commerce, foreign, 35, 57, 121, 231, 259
Cotton, 257, 258, 261
Croton River, 18
Custis, Martha, 294
Cuyahoga River, 137, 138, 140, 141, 145
Declaration of Independence, 8, 85
Delaware River, 67, 68, 69
de Portolá, Don Gaspar, 227
Des Plaines River, 53
Detroit, 139, 189–206
leading port on Canadian shore, 189, 199
founded, 191
early history, 191
growth, 192
trade center, 194
harbor, 195
shipbuilding industry, 195
becomes industrial city, 196
center of automobile trade, 196
industries, 197
immense wholesale trade, 198
railroad center, 200
Detroit River, 191, 200, 205
District of Columbia, 267, 288, 289
Doan, Nathaniel, 139
Dutch West India Company, 5
East River, 27, 36
East St. Louis, 98
Erie Canal, 9, 193, 209, 210, 212
Exports, value of, 301
Fall River, 121
Farragut, David, 248
Fillmore, Millard, 224
Fish industry, 121, 239
Fitch, John, 72
Fort Dearborn, 44
Fort McHenry, 169
Fort Myer, 294
Fort Pitt, 171
Foreign-born population, 300
Franklin, Benjamin, 73, 84
French and Indian War, 171, 191, 245
Fulton, Robert, 72
Girard, Stephen, 79
Gold, 227
Golden Gate, 231, 241
Grain industry, 55, 102
Granite City, 98
Gunpowder River, 163
Hale, Edward Everett, 130
Half Moon, 3
Hancock, John, 124
Homestead, 173
Hudson, Henry, 4
Hudson River, 4, 30, 35, 36, 207, 209, 210
Hull, General William, 192
Illinois and Michigan Canal, 47
Illinois River, 47, 53, 93
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
testbankdeal.com

More Related Content

Similar to Database Systems Design Implementation and Management 11th Edition Coronel Solutions Manual (20)

PDF
Database Systems Design Implementation and Management 11th Edition Coronel Te...
farmerposhia42
 
PDF
Modern Database Management 11th Edition Hoffer Solutions Manual
wennvoutaz13
 
PDF
Database Systems Design Implementation and Management 11th Edition Coronel Te...
sokktakei
 
PDF
Modern Database Management 11th Edition Hoffer Solutions Manual
bardhdinci22
 
PPT
Unit-3-SQL-part1.ppt
vipinpanicker2
 
PDF
Essentials of Database Management 1st Edition Hoffer Solutions Manual
lelanaarshat
 
PDF
Top 50 SQL Interview Questions and Answer.pdf
Rajkumar751652
 
DOC
Ora faq
vishpoola
 
DOC
Ora faq
vishpoola
 
PPTX
SQL.pptx
AmitDas125851
 
PPTX
Ebook3
kaashiv1
 
PPTX
Sql interview question part 3
kaashiv1
 
PDF
Modern Database Management 11th Edition Hoffer Solutions Manual
pathroborche
 
PDF
Modern Database Management 11th Edition Hoffer Solutions Manual
sxofmpd282
 
PPT
Review of SQL
Information Technology
 
PDF
Structured Query Language (SQL) - An Introduction
Rajeev Srivastava
 
PDF
Essentials of Database Management 1st Edition Hoffer Solutions Manual
saxlinsitou55
 
PDF
1Z0-061 Oracle Database 12c: SQL Fundamentals
Lydi00147
 
PDF
Modern Database Management 12th Edition Hoffer Solutions Manual
pabisroeunut
 
PDF
6_SQL.pdf
LPhct2
 
Database Systems Design Implementation and Management 11th Edition Coronel Te...
farmerposhia42
 
Modern Database Management 11th Edition Hoffer Solutions Manual
wennvoutaz13
 
Database Systems Design Implementation and Management 11th Edition Coronel Te...
sokktakei
 
Modern Database Management 11th Edition Hoffer Solutions Manual
bardhdinci22
 
Unit-3-SQL-part1.ppt
vipinpanicker2
 
Essentials of Database Management 1st Edition Hoffer Solutions Manual
lelanaarshat
 
Top 50 SQL Interview Questions and Answer.pdf
Rajkumar751652
 
Ora faq
vishpoola
 
Ora faq
vishpoola
 
SQL.pptx
AmitDas125851
 
Ebook3
kaashiv1
 
Sql interview question part 3
kaashiv1
 
Modern Database Management 11th Edition Hoffer Solutions Manual
pathroborche
 
Modern Database Management 11th Edition Hoffer Solutions Manual
sxofmpd282
 
Review of SQL
Information Technology
 
Structured Query Language (SQL) - An Introduction
Rajeev Srivastava
 
Essentials of Database Management 1st Edition Hoffer Solutions Manual
saxlinsitou55
 
1Z0-061 Oracle Database 12c: SQL Fundamentals
Lydi00147
 
Modern Database Management 12th Edition Hoffer Solutions Manual
pabisroeunut
 
6_SQL.pdf
LPhct2
 

Recently uploaded (20)

PPTX
Controller Request and Response in Odoo18
Celine George
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PDF
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
Difference between write and update in odoo 18
Celine George
 
PPTX
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PDF
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PPTX
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
PDF
Introduction presentation of the patentbutler tool
MIPLM
 
PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
Controller Request and Response in Odoo18
Celine George
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Difference between write and update in odoo 18
Celine George
 
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
Introduction presentation of the patentbutler tool
MIPLM
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
Ad

Database Systems Design Implementation and Management 11th Edition Coronel Solutions Manual

  • 1. Visit https://testbankdeal.com to download the full version and explore more testbank or solutions manual Database Systems Design Implementation and Management 11th Edition Coronel Solutions Manual _____ Click the link below to download _____ https://testbankdeal.com/product/database-systems-design- implementation-and-management-11th-edition-coronel- solutions-manual/ Explore and download more testbank or solutions manual at testbankdeal.com
  • 2. Here are some recommended products that we believe you will be interested in. You can click the link to download. Database Systems Design Implementation and Management 11th Edition Coronel Test Bank https://testbankdeal.com/product/database-systems-design- implementation-and-management-11th-edition-coronel-test-bank/ Database Systems Design Implementation and Management 12th Edition Coronel Solutions Manual https://testbankdeal.com/product/database-systems-design- implementation-and-management-12th-edition-coronel-solutions-manual/ Database Systems Design Implementation And Management 13th Edition Coronel Solutions Manual https://testbankdeal.com/product/database-systems-design- implementation-and-management-13th-edition-coronel-solutions-manual/ Business Communication In Person In Print Online 8th Edition Newman Solutions Manual https://testbankdeal.com/product/business-communication-in-person-in- print-online-8th-edition-newman-solutions-manual/
  • 3. Canadian Fundamentals of Nursing 6th Edition Potter Test Bank https://testbankdeal.com/product/canadian-fundamentals-of-nursing-6th- edition-potter-test-bank/ Implementing Organizational Change 3rd Edition Spector Solutions Manual https://testbankdeal.com/product/implementing-organizational- change-3rd-edition-spector-solutions-manual/ Strategic Human Resources Planning 7th Edition Belcourt Test Bank https://testbankdeal.com/product/strategic-human-resources- planning-7th-edition-belcourt-test-bank/ Visual Anatomy and Physiology Lab Manual Main Version 2nd Edition Sarikas Solutions Manual https://testbankdeal.com/product/visual-anatomy-and-physiology-lab- manual-main-version-2nd-edition-sarikas-solutions-manual/ Evolve Resources for Illustrated Anatomy of the Head and Neck 5th Edition Fehrenbach Test Bank https://testbankdeal.com/product/evolve-resources-for-illustrated- anatomy-of-the-head-and-neck-5th-edition-fehrenbach-test-bank/
  • 4. Dental Hygiene Applications to Clinical Practice 1st Edition Henry Test Bank https://testbankdeal.com/product/dental-hygiene-applications-to- clinical-practice-1st-edition-henry-test-bank/
  • 5. Chapter 7 An Introduction to Structured Query Language (SQL) 239 Chapter 7 Introduction to Structured Query Language (SQL) NOTE Several points are worth emphasizing: • We have provided the SQL scripts for both chapters 7 and 8. These scripts are intended to facilitate the flow of the material presented to the class. However, given the comments made by our students, the scripts should not replace the manual typing of the SQL commands by students. Some students learn SQL better when they have a chance to type their own commands and get the feedback provided by their errors. We recommend that the students use their lab time to practice the commands manually. • Because this chapter focuses on learning SQL, we recommend that you use the Microsoft Access SQL window to type SQL queries. Using this approach, you will be able to demonstrate the interoperability of standard SQL. For example, you can cut and paste the same SQL command from the SQL query window in Microsoft Access, to Oracle SQL * Plus and to MS SQL Query Analyzer. This approach achieves two objectives: ➢ It demonstrates that adhering to the SQL standard means that most of the SQL code will be portable among DBMSes. ➢ It also demonstrates that even a widely accepted SQL standard is sometimes implemented with slight distinctions by different vendors. For example, the treatment of date formats in Microsoft Access and Oracle is slightly different. Answers to Review Questions 1. In a SELECT query, what is the difference between a WHERE clause and a HAVING clause? Both a WHERE clause and a HAVING clause can be used to eliminate rows from the results of a query. The differences are 1) the WHERE clause eliminates rows before any grouping for aggregate functions occurs while the HAVING clause eliminates groups after the grouping has been done, and 2) the WHERE clause cannot contain an aggregate function but the HAVING clause can. 2. Explain why the following command would create an error, and what changes could be made to fix the error. SELECT V_CODE, SUM(P_QOH) FROM PRODUCT; The command would generate an error because an aggregate function is applied to the P_QOH attribute but V_CODE is neither in an aggregate function or in a GROUP BY. This can be fixed by either 1) placing V_CODE in an appropriate aggregate function based on the data that is being requested by the user, 2) adding a GROUP BY clause to group by values of V_CODE (i.e. GROUP BY V_CODE), 3) removing the V_CODE attribute from the SELECT clause, or 4) removing the Sum aggregate function from P_QOH. Which of these solutions is most appropriate depends on the question that the query was intended to answer.
  • 6. Chapter 7 An Introduction to Structured Query Language (SQL) 240 3. What type of integrity is enforced when a primary key is declared? Creating a primary key constraint enforces entity integrity (i.e. no part of the primary key can contain a null and the primary key values must be unique). 4. Explain why it might be more appropriate to declare an attribute that contains only digits as a character data type instead of a numeric data type. An attribute that contains only digits may be properly defined as character data when the values are nominal; that is, the values do not have numerical significance but serve only as labels such as ZIP codes and telephone numbers. One easy test is to consider whether or not a leading zero should be retained. For the ZIP code 03133, the leading zero should be retained; therefore, it is appropriate to define it as character data. For the quantity on hand of 120, we would not expect to retain a leading zero such as 0120; therefore, it is appropriate to define the quantity on hand as a numeric data type. 5. What is the difference between a column constraint and a table constraint? A column constraint can refer to only the attribute with which it is specified. A table constraint can refer to any attributes in the table. 6. What are “referential constraint actions”? Referential constraint actions, such as ON DELETE CASCADE, are default actions that the DBMS should take when a DML command would result in a referential integrity constraint violation. Without referential constraint actions, DML commands that would result in a violation of referential integrity will fail with an error indicating that the referential integrity constrain cannot be violated. Referential constraint actions can allow the DML command to successfully complete while making the designated changes to the related records to maintain referential integrity. 7. Rewrite the following WHERE clause without the use of the IN special operator. WHERE V_STATE IN (‘TN’, ‘FL’, ‘GA’) WHERE V_STATE = 'TN' OR V_STATE = 'FL' OR V_STATE = 'GA' Notice that each criteria must be complete (i.e. attribute-operator-value). 8. Explain the difference between an ORDER BY clause and a GROUP BY clause. An ORDER BY clause has no impact on which rows are returned by the query, it simply sorts those rows into the specified order. A GROUP BY clause does impact the rows that are returned by the query. A GROUP BY clause gathers rows into collections that can be acted on by aggregate functions. 9. Explain why the two following commands produce different results. SELECT DISTINCT COUNT (V_CODE) FROM PRODUCT;
  • 7. Chapter 7 An Introduction to Structured Query Language (SQL) 241 SELECT COUNT (DISTINCT V_CODE) FROM PRODUCT; The difference is in the order of operations. The first command executes the Count function to count the number of values in V_CODE (say the count returns "14" for example) including duplicate values, and then the Distinct keyword only allows one count of that value to be displayed (only one row with the value "14" appears as the result). The second command applies the Distinct keyword to the V_CODEs before the count is taken so only unique values are counted. 10. What is the difference between the COUNT aggregate function and the SUM aggregate function? COUNT returns the number of values without regard to what the values are. SUM adds the values together and can only be applied to numeric values. 11. Explain why it would be preferable to use a DATE data type to store date data instead of a character data type. The DATE data type uses numeric values based on the Julian calendar to store dates. This makes date arithmetic such as adding and subtracting days or fractions of days possible (as well as numerous special date-oriented functions discussed in the next chapter!). 12. What is a recursive join? A recursive join is a join in which a table is joined to itself. Problem Solutions O n l i n e C o n t e n t Problems 1 – 25 are based on the Ch07_ConstructCo database located www.cengagebrain.com. This database is stored in Microsoft Access format. The website provides Oracle, MySQL, and MS SQL Server script files. The Ch07_ConstructCo database stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each employee works on each project. The structure and contents of the Ch07_ConstructCo database are shown in Figure P7.1. Figure P7.1 Structure and contents of the Ch07_ConstructCo database
  • 8. Chapter 7 An Introduction to Structured Query Language (SQL) 242 Note that the ASSIGNMENT table in Figure P7.1 stores the JOB_CHG_HOUR values as an attribute (ASSIGN_CHG_HR) to maintain historical accuracy of the data. The JOB_CHG_HOUR values are likely to change over time. In fact, a JOB_CHG_HOUR change will be reflected in the ASSIGNMENT table. And, naturally, the employee primary job assignment might change, so the ASSIGN_JOB is also stored. Because those attributes are required to maintain the historical accuracy of the data, they are not redundant. Given the structure and contents of the Ch07_ConstructCo database shown in Figure P7.1, use SQL commands to answer Problems 1–25. 1. Write the SQL code that will create the table structure for a table named EMP_1. This table is a subset of the EMPLOYEE table. The basic EMP_1 table structure is summarized in the table below. (Note that the JOB_CODE is the FK to JOB.)
  • 9. Chapter 7 An Introduction to Structured Query Language (SQL) 243 ATTRIBUTE (FIELD) NAME DATA DECLARATION EMP_NUM CHAR(3) EMP_LNAME VARCHAR(15) EMP_FNAME VARCHAR(15) EMP_INITIAL CHAR(1) EMP_HIREDATE DATE JOB_CODE CHAR(3) CREATE TABLE EMP_1 ( EMP_NUM CHAR(3) PRIMARY KEY, EMP_LNAME VARCHAR(15) NOT NULL, EMP_FNAME VARCHAR(15) NOT NULL, EMP_INITIAL CHAR(1), EMP_HIREDATE DATE, JOB_CODE CHAR(3), FOREIGN KEY (JOB_CODE) REFERENCES JOB); NOTE We have already provided the EMP_1 table for you. If you try to run the preceding query, you will get an error message because the EMP_1 table already exits. 2. Having created the table structure in Problem 1, write the SQL code to enter the first two rows for the table shown in Figure P7.2. Figure P7.2 The contents of the EMP_1 table INSERT INTO EMP_1 VALUES (‘101’, ‘News’, ‘John’, ‘G’, ’08-Nov-00’, ‘502’); INSERT INTO EMP_1 VALUES (‘102’, ‘Senior’, ‘David’, ‘H’, ’12-Jul-89’, ‘501’); 3. Assuming the data shown in the EMP_1 table have been entered, write the SQL code that will list all attributes for a job code of 502. SELECT * FROM EMP_1 WHERE JOB_CODE = ‘502’;
  • 10. Chapter 7 An Introduction to Structured Query Language (SQL) 244 4. Write the SQL code that will save the changes made to the EMP_1 table. COMMIT; 5. Write the SQL code to change the job code to 501 for the person whose employee number (EMP_NUM) is 107. After you have completed the task, examine the results, and then reset the job code to its original value. UPDATE EMP_1 SET JOB_CODE = ‘501’ WHERE EMP_NUM = ‘107’; To see the changes: SELECT * FROM EMP_1 WHERE EMP_NUM = ‘107’; To reset, use ROLLBACK; 6. Write the SQL code to delete the row for the person named William Smithfield, who was hired on June 22, 2004, and whose job code classification is 500. (Hint: Use logical operators to include all of the information given in this problem.) DELETE FROM EMP_1 WHERE EMP_LNAME = 'Smithfield' AND EMP_FNAME = 'William' AND EMP_HIREDATE = '22-June-04' AND JOB_CODE = '500'; 7. Write the SQL code that will restore the data to its original status; that is, the table should contain the data that existed before you made the changes in Problems 5 and 6. ROLLBACK;
  • 11. Chapter 7 An Introduction to Structured Query Language (SQL) 245 8. Write the SQL code to create a copy of EMP_1, naming the copy EMP_2. Then write the SQL code that will add the attributes EMP_PCT and PROJ_NUM to its structure. The EMP_PCT is the bonus percentage to be paid to each employee. The new attribute characteristics are: EMP_PCTNUMBER(4,2) PROJ_NUMCHAR(3) (Note: If your SQL implementation allows it, you may use DECIMAL(4,2) rather than NUMBER(4,2).) There are two way to get this job done. The two possible solutions are shown next. Solution A: CREATE TABLE EMP_2 ( EMP_NUM CHAR(3) NOT NULL UNIQUE, EMP_LNAME VARCHAR(15) NOT NULL, EMP_FNAME VARCHAR(15) NOT NULL, EMP_INITIAL CHAR(1), EMP_HIREDATE DATE NOT NULL, JOB_CODE CHAR(3) NOT NULL, PRIMARY KEY (EMP_NUM), FOREIGN KEY (JOB_CODE) REFERENCES JOB); INSERT INTO EMP_2 SELECT * FROM EMP_1; ALTER TABLE EMP_2 ADD (EMP_PCT NUMBER (4,2)), ADD (PROJ_NUM CHAR(3)); Solution B: CREATE TABLE EMP_2 AS SELECT * FROM EMP_1; ALTER TABLE EMP_2 ADD (EMP_PCT NUMBER (4,2)), ADD (PROJ_NUM CHAR(3)); 9. Write the SQL code to change the EMP_PCT value to 3.85 for the person whose employee number (EMP_NUM) is 103. Next, write the SQL command sequences to change the EMP_PCT values as shown in Figure P7.9.
  • 12. Chapter 7 An Introduction to Structured Query Language (SQL) 246 Figure P7.9 The contents of the EMP_2 table UPDATE EMP_2 SET EMP_PCT = 3.85 WHERE EMP_NUM = '103'; To enter the remaining EMP_PCT values, use the following SQL statements: UPDATEEMP_2 SET EMP_PCT = 5.00 WHERE EMP_NUM = ‘101’; UPDATEEMP_2 SET EMP_PCT = 8.00 WHERE EMP_NUM = ‘102’; Follow this format for the remaining rows. 10. Using a single command sequence, write the SQL code that will change the project number (PROJ_NUM) to 18 for all employees whose job classification (JOB_CODE) is 500. UPDATE EMP_2 SET PROJ_NUM = '18' WHERE JOB_CODE = '500'; 11. Using a single command sequence, write the SQL code that will change the project number (PROJ_NUM) to 25 for all employees whose job classification (JOB_CODE) is 502 or higher. When you finish Problems 10 and 11, the EMP_2 table will contain the data shown in Figure P7.11. (You may assume that the table has been saved again at this point.)
  • 13. Chapter 7 An Introduction to Structured Query Language (SQL) 247 Figure P7.11 The EMP_2 table contents after the modification UPDATE EMP_2 SET PROJ_NUM = '25' WHERE JOB_CODE > = '502' 12. Write the SQL code that will change the PROJ_NUM to 14 for those employees who were hired before January 1, 1994 and whose job code is at least 501. (You may assume that the table will be restored to its condition preceding this question.) UPDATE EMP_2 SET PROJ_NUM = '14' WHERE EMP_HIREDATE <= ' 01-Jan-94' AND JOB_CODE >= '501'; 13. Write the two SQL command sequences required to: There are many ways to accomplish both tasks. We are illustrating the shortest way to do the job next. a. Create a temporary table named TEMP_1 whose structure is composed of the EMP_2 attributes EMP_NUM and EMP_PCT. The SQL code shown in problem 13b contains the solution for problem 13a. b. Copy the matching EMP_2 values into the TEMP_1 table. CREATE TABLE TEMP_1 AS SELECT EMP_NUM, EMP_PCT FROM EMP_2; An alternate way would be to create the table and then, use an INSERT with a sub-select to populate the rows. CREATE TABLE TEMP_1 AS ( EMP_NUM CHAR(3), EMP_PCT NUMBER(4,2)); INSERT INTO TEMP_1 SELECT EMP_NUM, EMP_PCT FROM EMP_2;
  • 14. Chapter 7 An Introduction to Structured Query Language (SQL) 248 14. Write the SQL command that will delete the newly created TEMP_1 table from the database. DROP TABLE TEMP_1; 15. Write the SQL code required to list all employees whose last names start with Smith. In other words, the rows for both Smith and Smithfield should be included in the listing. Assume case sensitivity. SELECT * FROM EMP_2 WHERE EMP_LNAME LIKE 'Smith%'; 16. Using the EMPLOYEE, JOB, and PROJECT tables in the Ch07_ConstructCo database (see Figure P7.1), write the SQL code that will produce the results shown in Figure P7.16. Figure P7.16 The query results for Problem 16 SELECT PROJ_NAME, PROJ_VALUE, PROJ_BALANCE, EMPLOYEE.EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMPLOYEE.JOB_CODE, JOB.JOB_DESCRIPTION, JOB.JOB_CHG_HOUR FROM PROJECT, EMPLOYEE, JOB WHERE EMPLOYEE.EMP_NUM = PROJECT.EMP_NUM AND JOB.JOB_CODE = EMPLOYEE.JOB_CODE; 17. Write the SQL code that will produce a virtual table named REP_1. The virtual table should contain the same information that was shown in Problem 16. CREATE VIEW REP_1 AS SELECT PROJ_NAME, PROJ_VALUE, PROJ_BALANCE, EMPLOYEE.EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMPLOYEE.JOB_CODE, JOB.JOB_DESCRIPTION, JOB.JOB_CHG_HOUR FROM PROJECT, EMPLOYEE, JOB WHERE EMPLOYEE.EMP_NUM = PROJECT.EMP_NUM AND JOB.JOB_CODE = EMPLOYEE.JOB_CODE;
  • 15. Chapter 7 An Introduction to Structured Query Language (SQL) 249 18. Write the SQL code to find the average bonus percentage in the EMP_2 table you created in Problem 8. SELECT AVG(EMP_PCT) FROM EMP_2; 19. Write the SQL code that will produce a listing for the data in the EMP_2 table in ascending order by the bonus percentage. SELECT * FROM EMP_2 ORDER BY EMP_PCT; 20. Write the SQL code that will list only the distinct project numbers found in the EMP_2 table. SELECT DISTINTC PROJ_NUM FROM EMP_2; 21. Write the SQL code to calculate the ASSIGN_CHARGE values in the ASSIGNMENT table in the Ch07_ConstructCo database. (See Figure P7.1.) Note that ASSIGN_CHARGE is a derived attribute that is calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS. UPDATE ASSIGNMENT SET ASSIGN_CHARGE = ASSIGN_CHG_HR * ASSIGN_HOURS; 22. Using the data in the ASSIGNMENT table, write the SQL code that will yield the total number of hours worked for each employee and the total charges stemming from those hours worked. The results of running that query are shown in Figure P7.22. Figure P7.22 Total hours and charges by employee
  • 16. Chapter 7 An Introduction to Structured Query Language (SQL) 250 SELECT ASSIGNMENT.EMP_NUM, EMPLOYEE.EMP_LNAME, Sum(ASSIGNMENT.ASSIGN_HOURS) AS SumOfASSIGN_HOURS, Sum(ASSIGNMENT.ASSIGN_CHARGE) AS SumOfASSIGN_CHARGE FROM EMPLOYEE, ASSIGNMENT WHERE EMPLOYEE.EMP_NUM = ASSIGNMENT.EMP_NUM GROUP BY ASSIGNMENT.EMP_NUM, EMPLOYEE.EMP_LNAME; 23. Write a query to produce the total number of hours and charges for each of the projects represented in the ASSIGNMENT table. The output is shown in Figure P7.23. Figure P7.23 Total hour and charges by project SELECT ASSIGNMENT.PROJ_NUM, Sum(ASSIGNMENT.ASSIGN_HOURS) AS SumOfASSIGN_HOURS, Sum(ASSIGNMENT.ASSIGN_CHARGE) AS SumOfASSIGN_CHARGE FROM ASSIGNMENT GROUP BY ASSIGNMENT.PROJ_NUM 24. Write the SQL code to generate the total hours worked and the total charges made by all employees. The results are shown in Figure P7.24. (Hint: This is a nested query. If you use Microsoft Access, you can generate the result by using the query output shown in Figure P7.22 as the basis for the query that will produce the output shown in Figure P7.24.) Figure P7.24 Total hours and charges, all employees Solution A: SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS, Sum(SumOfASSIGN_CHARGE) AS SumOfASSIGN_CHARGE FROM Q23; or
  • 17. Chapter 7 An Introduction to Structured Query Language (SQL) 251 SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS, Sum(SumOfASSIGN_CHARGE as SumOfASSIGN_CHARGE FROM (SELECT ASSIGNMENT.PROJ_NUM, Sum(ASSIGNMENT.ASSIGN_HOURS) AS SumOfASSIGN_HOURS, Sum(ASSIGNMENT.ASSIGN_CHARGE) AS SumOfASSIGN_CHARGE FROM ASSIGNMENT GROUP BY ASSIGNMENT.PROJ_NUM ); Solution B: SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS, Sum(SumOfASSIGN_CHARGE) AS SumOfASSIGN_CHARGE FROM Q22; or SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS, Sum(SumOfASSIGN_CHARGE) AS SumOfASSIGN_CHARGE FROM (SELECT ASSIGNMENT.EMP_NUM, EMPLOYEE.EMP_LNAME, Sum(ASSIGNMENT.ASSIGN_HOURS) AS SumOfASSIGN_HOURS, Sum(ASSIGNMENT.ASSIGN_CHARGE) AS SumOfASSIGN_CHARGE FROM EMPLOYEE, ASSIGNMENT WHERE EMPLOYEE.EMP_NUM = ASSIGNMENT.EMP_NUM GROUP BY ASSIGNMENT.EMP_NUM, EMPLOYEE.EMP_LNAME );
  • 18. Chapter 7 An Introduction to Structured Query Language (SQL) 252 25. Write the SQL code to generate the total hours worked and the total charges made to all projects. The results should be the same as those shown in Figure P7.24. (Hint: This is a nested query. If you use Microsoft Access, you can generate the result by using the query output shown in Figure P7.23 as the basis for this query.) SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS, Sum(SumOfASSIGN_CHARGE) AS SumOfASSIGN_CHARGE FROM Q23; or SELECT Sum(SumOfASSIGN_HOURS) AS SumOfASSIGN_HOURS, Sum(SumOfASSIGN_CHARGE as SumOfASSIGN_CHARGE FROM (SELECT ASSIGNMENT.PROJ_NUM, Sum(ASSIGNMENT.ASSIGN_HOURS) AS SumOfASSIGN_HOURS, Sum(ASSIGNMENT.ASSIGN_CHARGE) AS SumOfASSIGN_CHARGE FROM ASSIGNMENT GROUP BY ASSIGNMENT.PROJ_NUM ); O n l i n e C o n t e n t Problems 26−43 are based on the Ch07_SaleCo database, which is available at www.cengagebrain.com. This database is stored in Microsoft Access format. Oracle, MySQL and MS SQL Server script files are available at www.cengagebrain.com. The structure and contents of the Ch07_SaleCo database are shown in Figure P7.26. Use this database to answer the following problems. Save each query as QXX, where XX is the problem number. 26. Write a query to count the number of invoices. SELECT COUNT(*) FROM INVOICE; 27. Write a query to count the number of customers with a customer balance over $500. SELECT COUNT(*) FROM CUSTOMER WHERE CUS_BALANCE >500;
  • 19. Chapter 7 An Introduction to Structured Query Language (SQL) 253 28. Generate a listing of all purchases made by the customers, using the output shown in Figure P7.28 as your guide. (Hint: Use the ORDER BY clause to order the resulting rows as shown in Figure P7.28) FIGURE P7.28 List of Customer Purchases SELECT INVOICE.CUS_CODE, INVOICE.INV_NUMBER, INVOICE.INV_DATE, PRODUCT.P_DESCRIPT, LINE.LINE_UNITS, LINE.LINE_PRICE FROM CUSTOMER, INVOICE, LINE, PRODUCT WHERE CUSTOMER.CUS_CODE = INVOICE.CUS_CODE AND INVOICE.INV_NUMBER = LINE.INV_NUMBER AND PRODUCT.P_CODE = LINE.P_CODE ORDER BY INVOICE.CUS_CODE, INVOICE.INV_NUMBER, PRODUCT.P_DESCRIPT;
  • 20. Chapter 7 An Introduction to Structured Query Language (SQL) 254 29. Using the output shown in Figure P7.29 as your guide, generate the listing of customer purchases, including the subtotals for each of the invoice line numbers. (Hint: Modify the query format used to produce the listing of customer purchases in Problem 18, delete the INV_DATE column, and add the derived (computed) attribute LINE_UNITS * LINE_PRICE to calculate the subtotals.) FIGURE P7.29 Summary of Customer Purchases with Subtotals SELECT INVOICE.CUS_CODE, INVOICE.INV_NUMBER, PRODUCT.P_DESCRIPT, LINE.LINE_UNITS AS [Units Bought], LINE.LINE_PRICE AS [Unit Price], LINE.LINE_UNITS*LINE.LINE_PRICE AS Subtotal FROM CUSTOMER, INVOICE, LINE, PRODUCT WHERE CUSTOMER.CUS_CODE = INVOICE.CUS_CODE AND INVOICE.INV_NUMBER = LINE.INV_NUMBER AND PRODUCT.P_CODE = LINE.P_CODE ORDER BY INVOICE.CUS_CODE, INVOICE.INV_NUMBER, PRODUCT.P_DESCRIPT;
  • 21. Chapter 7 An Introduction to Structured Query Language (SQL) 255 30. Modify the query used in Problem 29 to produce the summary shown in Figure P7.30. FIGURE P7.30 Customer Purchase Summary SELECT INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE, Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Total Purchases] FROM CUSTOMER, INVOICE, LINE WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER AND CUSTOMER.CUS_CODE = INVOICE.CUS_CODE GROUP BY INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE; 31. Modify the query in Problem 30 to include the number of individual product purchases made by each customer. (In other words, if the customer’s invoice is based on three products, one per LINE_NUMBER, you would count three product purchases. If you examine the original invoice data, you will note that customer 10011 generated three invoices, which contained a total of six lines, each representing a product purchase.) Your output values must match those shown in Figure P7.31. FIGURE P7.31 Customer Total Purchase Amounts and Number of Purchases SELECT INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE, Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Total Purchases], Count(*) AS [Number of Purchases] FROM CUSTOMER, INVOICE, LINE WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER AND CUSTOMER.CUS_CODE = INVOICE.CUS_CODE GROUP BY INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE;
  • 22. Chapter 7 An Introduction to Structured Query Language (SQL) 256 32. Use a query to compute the average purchase amount per product made by each customer. (Hint: Use the results of Problem 31 as the basis for this query.) Your output values must match those shown in Figure P7.32. Note that the Average Purchase Amount is equal to the Total Purchases divided by the Number of Purchases. FIGURE P7.32 Average Purchase Amount by Customer SELECT INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE, Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Total Purchases], Count(*) AS [Number of Purchases], AVG(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Average Purchase Amount] FROM CUSTOMER, INVOICE, LINE WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER AND CUSTOMER.CUS_CODE = INVOICE.CUS_CODE GROUP BY INVOICE.CUS_CODE, CUSTOMER.CUS_BALANCE; 33. Create a query to produce the total purchase per invoice, generating the results shown in Figure P7.33. The Invoice Total is the sum of the product purchases in the LINE that corresponds to the INVOICE. FIGURE P7.33 Invoice Totals SELECT LINE.INV_NUMBER, Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Invoice Total] FROM LINE GROUP BY LINE.INV_NUMBER;
  • 23. Chapter 7 An Introduction to Structured Query Language (SQL) 257 34. Use a query to show the invoices and invoice totals as shown in Figure P7.34. (Hint: Group by the CUS_CODE.) FIGURE P7.34 Invoice Totals by Customer SELECT CUS_CODE, LINE.INV_NUMBER AS INV_NUMVER, Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Invoice Total] FROM INVOICE, LINE WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER GROUP BY CUS_CODE, LINE.INV_NUMBER; 35. Write a query to produce the number of invoices and the total purchase amounts by customer, using the output shown in Figure P7.35 as your guide. (Compare this summary to the results shown in Problem 34.) FIGURE P7.35 Number of Invoices and Total Purchase Amounts by Customer Note that a query may be used as the data source for another query. The following code is shown in qryP7.35A in your Ch07_Saleco database. Note that the data source is qryP6-34. SELECT CUS_CODE, Count(INV_NUMBER) AS [Number of Invoices], AVG([Invoice Total]) AS [Average Invoice Amount], MAX([Invoice Total]) AS [Max Invoice Amount], MIN([Invoice Total]) AS [Min Invoice Amount], Sum([Invoice Total]) AS [Total Customer Purchases] FROM [qryP7-34] GROUP BY [qryP7-34].CUS_CODE;
  • 24. Chapter 7 An Introduction to Structured Query Language (SQL) 258 Instead of using another query as your data source, you can also use an alias. The following code is shown in Oracle format. You can also find the MS Access “alias” version in qryP7.35B in your Ch07_SaleCo database.) SELECT CUS_CODE, COUNT(LINE.INV_NUMBER) AS [Number of Invoices], AVG([Invoice Total]) AS [Average Invoice Amount], MAX([Invoice Total]) AS [Max Invoice Amount], MIN([Invoice Total]) AS [Min Invoice Amount], Sum([Invoice Total]) AS [Total Customer Purchases] FROM (SELECT CUS_CODE, LINE.INV_NUMBER AS INV_NUMBER, Sum(LINE.LINE_UNITS*LINE.LINE_PRICE) AS [Invoice Total] FROM INVOICE, LINE WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER GROUP BY CUS_CODE, LINE.INV_NUMBER) GROUP BY CUS_CODE; 36. Using the query results in Problem 35 as your basis, write a query to generate the total number of invoices, the invoice total for all of the invoices, the smallest invoice amount, the largest invoice amount, and the average of all of the invoices. (Hint: Check the figure output in Problem 35.) Your output must match Figure P7.36. FIGURE P7.36 Number of Invoices, Invoice Totals, Minimum, Maximum, and Average Sales SELECT Count([qryP7-34].[INV_NUMBER]) AS [Total Invoices], Sum([qryP7-34].[Invoice Total]) AS [Total Sales], Min([qryP7-34].[Invoice Total]) AS [Minimum Sale], Max([qryP7-34].[Invoice Total]) AS [Largest Sale], Avg([qryP7-34].[Invoice Total]) AS [Average Sale] FROM [qryP7-34];
  • 25. Another Random Scribd Document with Unrelated Content
  • 26. STATUARY HALL, IN THE CAPITOL From the rotunda, broad corridors lead north to the Senate Chamber and south to the House of Representatives. Following the corridor to the south, we come to a large semicircular room. When the central division of the building was all there was to the Capitol, this room was occupied by the House of Representatives, and here were heard the speeches of Adams, Webster, Clay, Calhoun, and many other famous statesmen. It is now set apart as a national statuary hall, where each state may place two statues of her chosen sons. As many of the states have been glad to honor their great men in this way, a splendid array of national heroes is gathered in the hall. Among the Revolutionary heroes we find Washington, Ethan Allen, and Nathaniel Green. A statue of Fulton, sent by New York, shows him seated, looking at a model of his steamship. Of all these marble
  • 27. figures, perhaps none attracts more attention than that of Frances Elizabeth Willard, the great apostle of temperance, and to the state of Illinois belongs the distinction of having placed the only statue of a woman in this great collection. Leaving Statuary Hall, we go south to the Hall of Representatives. Here representatives from all the states gather to frame laws for the entire nation. Seated in the gallery it seems almost as if we were in a huge schoolroom, for the representatives occupy seats which are arranged in semicircles, facing a white marble desk upon a high platform reached by marble steps. This is the desk of the Speaker of the House. The Speaker's duty is to preserve order and to see that the business of this branch of Congress is carried on as it should be. Before delivering a speech, a representative must have the Speaker's permission. The Speaker is a most important person, for all business is transacted under his direction. The representatives come from every state in the Union, and even far-off Hawaii, Alaska, and the Philippines are allowed to send delegates to this assembly to represent them in making laws. Think what a serious matter it would have been to the people of the far West to have the capital of their nation in the extreme Eastern section of the country if the development of the railroads, the telegraph, and the telephone had not made travel and communication so easy that great distances are no longer obstacles.
  • 28. THE OPENING OF CONGRESS But we can pay only a brief visit to the House of Representatives, for there is another body of lawmakers in the northern end of the Capitol which we wish to see. Back to the rotunda we go and then walk along a corridor leading to the northern, or Senate, end of the Capitol. Each day, for a number of months in the year, an interesting ceremony takes place in this corridor promptly at noon. Nine dignified men, clad in long black silk robes, march in solemn procession across the corridor and enter a stately chamber which, though smaller, resembles Statuary Hall in shape. These men make up the Supreme Court of the United States, the highest court of justice in the land.
  • 29. Often in cases at law a person does not feel that the decision of one court has been just. He may then have his case examined and passed upon by a higher court. This is called “appealing,” and some cases, for good cause, may be appealed from one court to another until they reach the Supreme Court. Beyond the Supreme Court there is no appeal. What this court decides must be accepted as final. The room in which the Supreme Court meets was once used as the Senate Chamber, and many of the great debates heard in the Senate before our Civil War were held in this room. The Senate Chamber of to-day is further down the north corridor. This room is not unlike the Hall of Representatives in plan and arrangement, though it is somewhat smaller. Instead of having a chairman of their own choosing, as is the case in the House, the Senate is presided over by the vice president of the United States. This high official, seated upon a raised platform, directs the proceedings of the Senate just as the Speaker directs those of the House of Representatives. There seems to be an air of greater solemnity and dignity in this small group of lawmakers than in the House of Representatives. It is smaller because each state is entitled to send but two senators to the Senate, whereas the number of representatives is governed by the number of inhabitants in the state. The populous state of New York has thirty-seven representatives and but two senators, the same number as the little state of Rhode Island whose population entitles it to only two representatives. The purpose of having two lawmaking bodies is to provide a safeguard against hasty and unwise legislation. In the House of Representatives the most populous states have the greatest influence, while in the Senate all states are equally represented, and each state has two votes regardless of its size and population. Since
  • 30. every proposed law must be agreed to in both the Senate and the House before it is taken to the president for his approval, each body acts as a check on the other in lawmaking. INAUGURAL PARADE ON PENNSYLVANIA AVENUE Just to the east of the Capitol grounds stands the magnificent Library of Congress. This wonderful storehouse of books is a marvelous palace. It covers almost an entire city block, and its towering gilded dome is visible from almost every part of the city. Once inside, we could easily believe ourselves in fairyland, so beautiful are the halls and the staircases of carved marble, so wonderful the paintings and the decorations. Every available space upon the walls and ceilings is adorned with pictures, with the names of the great men of the world, and with beautiful quotations from the poets and scholars who seem to live again in this magnificent building which is dedicated to the things they loved.
  • 31. BOTANICAL GARDENS In the center of the building, just beneath the gilded dome, is a rotunda slightly wider than the rotunda of the Capitol, though not so high. Here are desks for the use of those who wish to consult any volume of the immense collection of books. The books are kept in great structures called stacks, 9 stories high and containing bookshelves which would stretch nearly 44 miles if placed in one line. Any one of the great collection of 1,300,000 volumes can be sent by machinery from the stacks to the reading room or to the Capitol. When a member of Congress wants a book which is in the Library, he need not leave the Capitol, for there is a tunnel connecting the two buildings through which runs a little car to carry books.
  • 32. The Librarian of Congress has charge of the enforcement of the copyright law. By means of this law an author may secure the exclusive right to publish a book, paper, or picture for twenty-eight years. One of the requirements of the copyright law is that the author must place in the Library of Congress two copies of whatever he has copyrighted. Hence, on the shelves of this great library may be found almost every book or paper published in the United States. Leaving the Library we once more find ourselves upon the great esplanade east of the Capitol. In the majestic white-marble buildings to the north and south,—known as the Senate and House office buildings,—committees of each House of Congress meet to discuss proposed laws. Having seen the lawmakers at work in the Capitol, let us visit the officials whose duty it is to enforce the laws made by Congress. Chief among these is the president of the United States. His house is officially known as the Executive Mansion, but nearly everybody speaks of it as the White House. The first public building erected in Washington was the White House. It is said that Washington himself chose the site. He lived to see it built but not occupied, for the capital was not moved to the District of Columbia until 1800, a year after Washington's death.
  • 33. THE WHITE HOUSE FROM THE NORTH This simple, stately building is a fitting home for the head of a great republic. In the main building are the living apartments of the president and his family, and the great rooms used for state receptions; the largest and handsomest of these is the famous East Room. Other rooms used on public occasions are known, from the color of the furnishings and hangings, as the Blue Room, the Green Room, and the Red Room. There is also the great State Dining Room, where the president entertains at dinner the important government officials and foreign representatives. In the Annex, adjoining the White House on the west, are the offices of the president and those who assist him in his work. In this part of the building is the cabinet room, where the president meets
  • 34. the heads of the various departments to consult with them concerning questions of national importance. Across the street from the president's office is the immense granite building occupied by the three departments of State, War, and Navy. The secretaries in charge of these departments have their offices here, together with a small army of clerks. THE UNITED STATES TREASURY On the opposite side of the White House from the State, War, and Navy Building is the National Treasury. The Treasury Building is one of the finest in the city. To see the splendid colonnade on the east is alone worth a journey to Washington. From this building all the money affairs of the United States government are directed. In the Treasury Building and in the Bureau of Engraving and Printing one may see the entire process of manufacturing and issuing paper money. In the Treasury we see new bills exchanged for old,
  • 35. worn-out bills, which are ground to pieces to destroy forever their value as money. BUREAU OF ENGRAVING AND PRINTING, “UNCLE SAM'S MONEY FACTORY” But to understand the story of a dollar bill or a bill of any other value we must visit the Bureau of Engraving and Printing. This building, which is some distance from the Treasury Building, reminds us of a large printing office, and that is just what it is. Here we are shown from room to room where many men and women are at work, some engraving the plates from which bills are to be printed and others printing the bills. The paper used is manufactured by a secret process for United States money, and every sheet is most carefully counted at every stage of the printing. Altogether the sheets are
  • 36. counted fifty-two times. Many clerks are employed to keep a careful account of these sheets, and it is almost impossible for a single bill or a single piece of paper to be lost or stolen. After the money is printed it is put into bundles, sealed, and sent in a closely guarded steel wagon to the Treasury Building, where it is stored in great vaults until it is issued. A CIRCLE AND ITS RADIATING AVENUES At the Treasury we find the officials sending out these crisp new bills in payment of the debts of the United States or in exchange for bills which are so tattered and torn that they are no longer useful. This exchanging of new money for old is a large part of the business of the Treasury and calls for the greatest care in counting and keeping records, in order that no mistakes may be made. After the old bills are counted they are cut in half and the halves counted separately, to make sure that the first count was correct.
  • 37. When the exact amount of money has been determined, new bills are sent out to the owners of the old bills, and the old bills are destroyed. When we have seen enough of the counting of old money, our guide takes us down into the cellar of this great building, where we walk along a narrow passageway with millions of dollars in gold and silver on either hand. All is carefully secured by massive doors and locks, and none but trusted officials may enter the vaults themselves. These gold and silver coins are made in the United States mints in Philadelphia, Denver, New Orleans, and San Francisco. You see the paper bill is not real money but a sort of receipt representing gold and silver money which you can get at any time from the Treasury. As we peep through the barred doors of the vaults and see great piles of canvas sacks, it is interesting to know that some of the silver and gold coins they hold are ours, waiting here while we carry in our pockets the paper bills which represent them. In addition to issuing money, the Treasury Department has charge of collecting all the taxes and duties which furnish the money for the payment of the expenses of the government. Washington is a government city. Of its population of over 330,000, about 36,000 are directly engaged in the various departments of the government, while most of the other lines of business thrive by supplying the needs of the government's employees and their families. Very little manufacturing is done in the District of Columbia, and such articles as are manufactured are chiefly for local use. People from almost every country in the world may be seen on the streets, for almost all civilized nations have ministers or ambassadors at Washington to represent them in official dealings with the United
  • 38. States. These foreign representatives occupy fine homes, and during the winter season many brilliant receptions are given by them as well as by our own high officials. CONTINENTAL MEMORIAL HALL The people of Washington have built fine churches and many handsome schools, to which all, from the president to the humblest citizen, send their children. In or near the city are the five universities of George Washington, Georgetown, Howard University for colored people, the Catholic University, and the American University, where graduates from other colleges take advanced work.
  • 39. ANNEX AND GARDEN OF THE PAN-AMERICAN UNION The citizens of the District of Columbia do not vote nor do they make their own laws, as it was feared there might be a disagreement between Congress and the city government if people voted on local matters. All laws for the District of Columbia are made by the Congress of the United States and are carried out by three commissioners appointed by the president with the consent of the Senate. Many inhabitants of the District are citizens of the states and go to their homes at election time to cast their votes. Isn't it strange that there is a place in the United States where the citizens cannot vote?
  • 40. UNION STATION You are, no doubt, beginning to think that the places of interest in Washington must be very numerous. This is true, for few cities in the world have so many interesting public buildings. Among these are the Corcoran Art Gallery; the Continental Memorial Hall, the majestic marble building of the Daughters of the American Revolution; and the palatial home of the Pan-American Union, a place where representatives of all the American republics may meet. Then there is the Patent Office, for recording and filing old patents and granting new ones; the Pension Office, from which our war veterans receive a certain sum each year; the Government Printing Office, whose reports require over a million dollars' worth of paper each year; Ford's Theater, where President Lincoln was shot; the naval-gun factory, for making the fourteen-inch long-range guns used on our battleships; and the Union Railroad Station, whose east wing is reserved for the use of the president. There is one almost sacred spot, upon which the nation has erected a splendid memorial to our greatest hero, George Washington. The Washington Monument is a simple obelisk of white marble, that towers 555 feet above the beautiful park in the midst of which it stands. Those openings near the top which seem so small are 504 feet above us and are actually large windows. On entering
  • 41. WASHINGTON MONUMENT FROM CONTINENTAL MEMORIAL HALL the door at the base of the monument, we pass through the wall, which is 15 feet thick, and find an elevator ready to carry us to the top. If we prefer to walk, there is an interior stairway of 900 steps leading to the top landing. At the end of our upward journey we find ourselves in a large room with two great windows on each of the four sides. From here we get another view of the hill-surrounded city, and the scene which lies before us is inspiring. The Washington Monument is near the western end of the Mall, that series of parks extending from the Capitol to the Potomac River. Near by are the buildings of the Department of Agriculture, which has been of the greatest help to the farmers of our land by sending out important information concerning almost everything connected with farm life. Through the Bureau of Chemistry this department did much to bring about the passage of the Pure Food Law, which protects the people by forbidding the sale of food and drugs that are not pure.
  • 42. In the spacious park adjoining the grounds of the Department of Agriculture is a building which looks like an ancient castle. This is the Smithsonian Institution, which carries on scientific work under government control. The National Museum, which is under the control of the Smithsonian Institution, has a fine building of its own. This museum is a perfect treasure house of interesting exhibits of all kinds. Here may be seen relics of Washington, of General Grant, and of other famous Americans; and here are exhibits showing the history of the telegraph, the telephone, the sewing machine, the automobile, and the flying machine. Stuffed animals of all kinds are arranged to look just as if they were alive. So numerous are the exhibits that it would require a large book simply to mention them. Many of the boys and girls of Washington spend their Saturday afternoons examining the wonderful things which have been brought to this museum from all parts of the world. THE CITY FROM ARLINGTON HEIGHTS
  • 43. Washington has also a zoölogical park where there are animals from everywhere. It is on the banks of a beautiful stream on the outskirts of the city and is part of a great public park which covers many acres of picturesque wooded country. We must not omit the Post Office Department, for that is the part of the federal government which comes nearest to our homes. Here are the offices of the postmaster general and his many assistants. To tell of the wonders of our postal system would be a long story in itself. If all the people employed by the Post Office Department lived in Washington, they would fill all of the houses and leave no room for anyone else. Of course this great army of employees are not all in any one city, for the work of the post office extends to every part of the United States, and, through arrangement with other nations, to every part of the civilized world. In the country surrounding the city of Washington are several important and interesting places. Just across the river, in the state of Virginia, are Fort Myer, an army post, and the famous Arlington National Cemetery. Arlington was the home of Martha Custis, who became the bride of George Washington. At the opening of the Civil War it was the home of the famous Confederate general, Robert E. Lee. Then it passed into the hands of the United States government and is now the burial place of over sixteen thousand soldiers who gave their lives for their country. On the Virginia shore of the Potomac River, sixteen miles south of the city of Washington, is Mount Vernon, the home and burial place of George Washington. The spacious old mansion in the midst of fine trees and shady lawns looks out over the wide peaceful river which Washington loved. To this home Washington came to live shortly after his marriage. He spent his time in farming on this estate until he
  • 44. was called to take command of the American army. After our independence was won he returned to his home and his farm. Once more he was called upon to leave this quiet country life to become the first president of the new nation. When he had served his country two terms he gladly retired to Mount Vernon, where he lived until his death in 1799. WASHINGTON'S TOMB To-day the house and grounds are preserved with loving care. The rooms of the house are furnished with fine old mahogany furniture, many pieces of which belonged to Washington. In the grounds, not far from the stately mansion, is the simple brick tomb where rest the bodies of Washington and his wife. During the years which have passed since his death, thousands of his countrymen have come to this tomb to do honor to his memory.
  • 45. As we sail up the Potomac toward the city after our visit to the home of the great man whose name it bears, the Washington Monument, the White House, the State, War, and Navy Building, the Capitol, the Library, and the post office tower above the surrounding buildings and, shining in the golden light of sunset, make a picture never to be forgotten. This city of parks, of broad avenues, of beautiful buildings, belongs to the Americans who live in the far-distant states as well as to those who live and work in the capital itself. It is our capital and we may justly be proud of it, for it is one of the most beautiful cities in all the world. WASHINGTON FACTS TO REMEMBER The capital of the nation. Population (1910), nearly 350,000 (331,069). Sixteenth city in rank, according to population. Center of the federal government of the United States. Governed entirely by Congress under provision of the Constitution. Chief offices of every department of the federal government located here. Splendid streets, avenues, parks, and monuments.
  • 46. Many magnificent public buildings. Very few manufacturing industries. A city of homes of government employees. One of the most interesting and beautiful cities in the world. QUESTIONS FOR REVIEW AND STUDY 1. Give some reasons why every citizen of the United States should be interested in Washington. 2. What interesting buildings are located here, and for what are they used? 3. What were some of the reasons for selecting the location of the capital city? 4. After whom was the city named? 5. In what year did Washington become the capital city, and what disaster visited it a few years later? 6. Describe the plan of the city, and name one of its famous streets. 7. Name three interesting groups of buildings: one on Capitol Hill, one on Pennsylvania Avenue, and one in the Mall. 8. What are some of the natural beauties of the city? 9. Give some idea of the size and beauty of the Capitol and of the imposing ceremony which takes place there every four years.
  • 47. 10. Describe briefly the House of Representatives when in session and the duties of its members. 11. Where does the Supreme Court of the country sit, and why is it called the Supreme Court? 12. How does the Senate differ from the House of Representatives? What are the duties of senators? How many come from each state? 13. Why do we have two lawmaking bodies? 14. Name some of the attractions of the Library of Congress. Tell how its books are stacked and how they are sent to the Capitol, and give some facts about the copyright law. 15. Tell what you know of the White House. 16. What two fine buildings are on either side of the White House, and for what is each used? 17. Describe the making of paper money. 18. What are the duties of the Treasury Department, and what may be seen in the Treasury vaults? 19. Tell something about the people of Washington, their chief occupation, and why so many foreign diplomats have their homes here. 20. How are the city of Washington and the District of Columbia governed? 21. Name some places of interest in Washington not already mentioned.
  • 48. 22. Describe the splendid monument by which our greatest hero is honored. 23. Tell why you would like to visit the Smithsonian Institution, the National Museum, and the Zoölogical Park. 24. Why are Fort Myer, Arlington, and Mount Vernon very interesting to all citizens of the United States? 25. To whom does the beautiful city of Washington really belong, and why should we be proud of it?
  • 49. REFERENCE TABLES LARGEST CITIES OF THE WORLD ACCORDING TO POPULATION Rank London 1 New York 2 Paris 3 Chicago 4 Berlin 5 Tokio 6 Vienna 7 Petrograd 8 Philadelphia 9 Moscow 10 Buenos Ayres 11 Constantinople 12 INCREASE IN POPULATION OF OUR GREAT CITIES— NATIONAL CENSUS City Population Rank 1910 1900 1890 1910 19001890 New York 4,766,883 3,437,202 1,515,301 1 1 1 Chicago 2,185,283 1,698,575 1,099,850 2 2 2 Philadelphia 1,549,008 1,293,697 1,046,964 3 3 3 St. Louis 687,029 575,238 451,770 4 4 5 Boston 670,585 560,892 448,477 5 5 6 Cleveland 560,663 381,768 261,353 6 7 10
  • 50. Baltimore 558,485 508,957 434,439 7 6 7 Pittsburgh 533,905 321,616 238,617 8 11 13 Detroit 465,766 285,704 205,876 9 13 15 Buffalo 423,715 352,387 255,664 10 8 11 San Francisco 416,912 342,782 298,997 11 9 8 Milwaukee 373,857 285,315 204,468 12 14 16 Cincinnati 363,591 325,902 296,908 13 10 9 Newark 347,469 246,070 181,830 14 16 17 New Orleans 339,075 287,104 242,039 15 12 12 Washington 331,069 278,718 230,392 16 15 14 THE FOREIGN-BORN POPULATION OF OUR GREAT CITIES City Leading Countries of Birth of Foreign-Born Population—1910 First Second Baltimore Germany Russia Boston Ireland Canada Buffalo Germany Canada Chicago Germany Austria Cincinnati Germany Hungary Cleveland Austria Germany Detroit Germany Canada Jersey City Germany Ireland Los Angeles Germany Canada Milwaukee Germany Russia Minneapolis Sweden Norway New Orleans Italy Germany New York Russia Italy Newark Germany Russia Philadelphia Russia Ireland Pittsburgh Germany Russia St. Louis Germany Russia
  • 51. San Francisco Germany Ireland Washington Ireland Germany SHORTEST RAILWAY TRAVEL—DISTANCE FROM NEW YORK CITY San Francisco 3182 miles New Orleans 1344 miles St. Louis 1059 miles Chicago 908 miles Detroit 690 miles Cleveland 576 miles Pittsburgh 441 miles Buffalo 439 miles Boston 235 miles Washington, D.C. 226 miles Baltimore 186 miles Philadelphia 92 miles SHORTEST RAILWAY TRAVEL—DISTANCE FROM CHICAGO San Francisco 2274 miles Boston 1021 miles New Orleans 923 miles New York 908 miles Philadelphia 818 miles Baltimore 797 miles Washington, D.C. 787 miles Buffalo 523 miles Pittsburgh 468 miles Cleveland 339 miles St. Louis 286 miles
  • 52. Detroit 272 miles TO WHOM WE SELL THE MOST The Amount for 1914 Great Britain $594,271,863 Germany $344,794,276 Canada $344,716,981 France $159,818,924 Netherlands $112,215,673 Italy $74,235,012 Cuba $68,884,428 Belgium $61,219,894 Japan $51,205,520 Argentina $45,179,089 Mexico $38,748,793 FROM WHOM WE BUY THE MOST The Amount for 1914 Great Britain $293,661,304 Germany $189,919,136 Canada $160,689,709 France $141,446,252 Cuba $131,303,794 Japan $107,355,897 Brazil $101,303,794 Mexico $92,690,566 British India $73,630,880 Italy $56,407,671
  • 53. SOME OF THE GREAT RAILROADS OF THE UNITED STATES
  • 54. INDEX Abbey, Edwin A., 128 Adams, John, 84, 87 Adams, Samuel, 124 Alameda, 240 Allegheny, 182, 184 Allegheny River, 171, 172, 182 Baldwin, Matthias W., 71 Baldwin Locomotive Works, 71 Baltimore, 155–170 railroad center, 155 harbor, 155 industries, 155, 156 exports, 155 fire of 1904, 156 public markets, 160 settlement of, 167 Baltimore, Lord, 168 Barge canal, 212 Belleville, 98 Berkeley, 240 Bienville, Governor, 245 Blackstone, William, 105 Boston, 105–136 capital of Massachusetts, 105 settlement of, 105 divisions of, 107
  • 55. harbor, 108 trade center, 119 foreign commerce, 121 industries, 121 Boston Tea Party, 84, 122 Braddock, 173 Bradford, William, 73 Brockton, 119 Brooklyn, 11, 24, 28, 30 Brooks, Phillips, 127 Bruceton, 178 Buffalo, 207–226 settlement of, 207, 208 named, 209 Erie Canal, 210 lake port, 211 importance of location, 212 trade with Canada, 212 manufacturing center, 213 Niagara power, 213, 216, 224–225 iron industry, 214 flour mills, 216 important live-stock market, 217 important lumber market, 217 harbor, 221 Buffalo River, 207, 221 Bulfinch, Charles, 111 Cadillac, Antoine de la Mothe, 191 Calumet River, 56 Cambridge, 116, 117, 131, 133 Carnegie, Andrew, 184 Carnegie Steel Company, 175
  • 56. Centennial Exhibition, 75 Charles River, 116 Chicago, 41–66, 180 fire of 1871, 41 settlement of, 43 harbor, 45, 56, 57 becomes a city, 46 important railroad center, 54 greatest lake port, 54 grain market, 55 steel industry, 56 largest lumber market, 57 exports, 57 center of packing industry, 61 Pullman, 62 Chicago drainage and ship canal, 54 Chicago River, 41, 43, 45, 53, 54, 57 Civil War, 247 Cleaveland, General Moses, 137 Cleveland, 137–154, 180 settlement of, 137 harbor, 141 becomes a city, 142 industries, 142, 143, 148 importance of location, 148 manufacturing center, 148 largest ore market in the world, 148 center of shipbuilding, 148 important lake port, 153 Cleveland, Grover, 224 Clinton, De Witt, 209 Coal, 56, 70, 100, 142, 172, 175, 213, 214, 215, 257 Coal mines, 175
  • 57. Commerce, foreign, 35, 57, 121, 231, 259 Cotton, 257, 258, 261 Croton River, 18 Custis, Martha, 294 Cuyahoga River, 137, 138, 140, 141, 145 Declaration of Independence, 8, 85 Delaware River, 67, 68, 69 de Portolá, Don Gaspar, 227 Des Plaines River, 53 Detroit, 139, 189–206 leading port on Canadian shore, 189, 199 founded, 191 early history, 191 growth, 192 trade center, 194 harbor, 195 shipbuilding industry, 195 becomes industrial city, 196 center of automobile trade, 196 industries, 197 immense wholesale trade, 198 railroad center, 200 Detroit River, 191, 200, 205 District of Columbia, 267, 288, 289 Doan, Nathaniel, 139 Dutch West India Company, 5 East River, 27, 36 East St. Louis, 98 Erie Canal, 9, 193, 209, 210, 212 Exports, value of, 301
  • 58. Fall River, 121 Farragut, David, 248 Fillmore, Millard, 224 Fish industry, 121, 239 Fitch, John, 72 Fort Dearborn, 44 Fort McHenry, 169 Fort Myer, 294 Fort Pitt, 171 Foreign-born population, 300 Franklin, Benjamin, 73, 84 French and Indian War, 171, 191, 245 Fulton, Robert, 72 Girard, Stephen, 79 Gold, 227 Golden Gate, 231, 241 Grain industry, 55, 102 Granite City, 98 Gunpowder River, 163 Hale, Edward Everett, 130 Half Moon, 3 Hancock, John, 124 Homestead, 173 Hudson, Henry, 4 Hudson River, 4, 30, 35, 36, 207, 209, 210 Hull, General William, 192 Illinois and Michigan Canal, 47 Illinois River, 47, 53, 93
  • 59. Welcome to our website – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! testbankdeal.com