Database Design Application Development and Administration 3rd Edition Mannino Solutions Manual pdf download
Database Design Application Development and Administration 3rd Edition Mannino Solutions Manual pdf download
https://testbankdeal.com/product/database-design-application-
development-and-administration-3rd-edition-mannino-solutions-
manual/
https://testbankdeal.com/product/database-design-application-
development-and-administration-3rd-edition-mannino-test-bank/
https://testbankdeal.com/product/medical-instrumentation-application-
and-design-4th-edition-webster-solutions-manual/
https://testbankdeal.com/product/leadership-theory-application-and-
skill-development-5th-edition-lussier-solutions-manual/
https://testbankdeal.com/product/macroeconomics-6th-edition-
williamson-test-bank/
Fundamentals of Pharmacology 8th Edition Bullock Test Bank
https://testbankdeal.com/product/fundamentals-of-pharmacology-8th-
edition-bullock-test-bank/
https://testbankdeal.com/product/business-english-11th-edition-guffey-
test-bank/
https://testbankdeal.com/product/comparative-international-
accounting-13th-edition-nobes-solutions-manual/
https://testbankdeal.com/product/basic-marketing-research-using-
microsoft-excel-data-analysis-3rd-edition-burns-solutions-manual/
https://testbankdeal.com/product/revel-for-learning-u-s-history-
semester-1-1st-edition-brands-test-bank/
Physiology 7th Edition Koeppen Test Bank
https://testbankdeal.com/product/physiology-7th-edition-koeppen-test-
bank/
Answers to Chapter 10 Problems
In Microsoft Access, it is easier to use stored queries rather than views. For stored queries,
you should save the SELECT statement (the view definition) with the indicated query name.
After saving a stored query, you can use it in other queries. You can only use the CREATE
VIEW statement in SQL-92 query mode in Access. To use a view in Access, you must
execute the CREATE VIEW statement before executing queries that use the view. In
Oracle, you must use the CREATE VIEW statement. The DROP VIEW statements are
included in case you previously created the view. If you did not create the view, the DROP
VIEW statements are not needed.
1.
Oracle DROP VIEW and CREATE VIEW statements:
DROP VIEW Chpt10_01;
In SQL-89 mode in Access, you should save the stored query as CHPT10_01.
SELECT *
FROM Product
WHERE SuppNo = 'S3399214'
In SQL-92 mode in Access, you can create the view with the following statement. You need
to create the view as a data definition query. You should save the view definition before
executing the view definition. You must execute the view before it can be used in queries.
2.
Oracle DROP VIEW and CREATE VIEW statements:
DROP VIEW Chpt10_02;
/
11/20/2023 Answers to Chapter 10 Problems 3
In SQL-89 query mode in Access, you should save the SELECT statement as “Chpt10_02”:
SELECT OrderTbl.*, OrdLine.Qty, ProdName
FROM OrderTbl, OrdLine, Product
WHERE OrdDate BETWEEN #1/1/2007# AND #1/31/2007#
AND Product.ProdNo = OrdLine.ProdNo
AND OrderTbl.OrdNo = OrdLine.OrdNo
In SQL-92 mode in Access, you can create the view with the following statement. You need
to create the view as a data definition query. You should save the view definition before
executing the view definition. You must execute the view before it can be used in queries.s
3.
Oracle DROP VIEW and CREATE VIEW statements:
DROP VIEW Chpt10_03;
In SQL-89 query mode in Access, you should save the SELECT statement as “Chpt10_03”:
SELECT Product.ProdNo, ProdName, ProdPrice, ProdQOH, COUNT(*) AS NumOrders
FROM Product, OrdLine
WHERE Product.ProdNo = OrdLine.ProdNo
GROUP BY Product.ProdNo, ProdName, ProdPrice, ProdQOH
In SQL-92 mode in Access, you can create the view with the following statement. You need
to create the view as a data definition query. You should save the view definition before
executing the view definition. You must execute the view before it can be used in queries.
4.
SELECT *
FROM Chpt10_01
WHERE ProdPrice > 300
In Access SQL-92 query mode, you must execute the view definition statement before you
can use a view. If you are using a stored query instead of a view, you do not need to execute
the stored query before using it.
5.
Access SQL-89:
SELECT *
FROM Chpt10_02
WHERE ProdName LIKE '*Ink Jet*'
In Access SQL-92 query mode, you must execute the view definition statement before you
can use a view. If you are using a stored query instead of a view, you do not need to execute
the stored query before using it.
6.
SELECT ProdName, NumOrders
FROM Chpt10_03
WHERE NumOrders > 5
In Access SQL-92 query mode, you must execute the view definition statement before you
can use a view. If you are using a stored query instead of a view, you do not need to execute
the stored query before using it.
7.
SELECT *
FROM Product
WHERE SuppNo = 'S3399214' AND ProdPrice > 300
11/20/2023 Answers to Chapter 10 Problems 5
8.
Access SQL-89:
SELECT OrderTbl.*, OrdLine.Qty, ProdName
FROM OrderTbl, OrdLine, Product
WHERE OrdDate BETWEEN #1/1/2007# AND #1/31/2007#
AND Product.ProdNo = OrdLine.ProdNo
AND OrderTbl.OrdNo = OrdLine.OrdNo
AND ProdName LIKE '*Ink Jet*'
Access SQL-92:
SELECT OrderTbl.*, OrdLine.Qty, ProdName
FROM OrderTbl, OrdLine, Product
WHERE OrdDate BETWEEN #1/1/2007# AND #1/31/2007#
AND Product.ProdNo = OrdLine.ProdNo
AND OrderTbl.OrdNo = OrdLine.OrdNo
AND ProdName LIKE '%Ink Jet%'
Oracle SQL:
SELECT OrderTbl.*, OrdLine.Qty, ProdName
FROM OrderTbl, OrdLine, Product
WHERE OrdDate BETWEEN '1-Jan-2007' AND '31-Jan-2007'
AND Product.ProdNo = OrdLine.ProdNo
AND OrderTbl.OrdNo = OrdLine.OrdNo
AND ProdName LIKE '%Ink Jet%'
/
9.
SELECT ProdName, COUNT(*) AS NumOrders
FROM Product, OrdLine
WHERE Product.ProdNo = OrdLine.ProdNo
GROUP BY ProdName
HAVING COUNT(*) > 5
10.
View1 is updatable because it includes the primary key and other required columns of the
Product table.
11.
View2 is not updatable for the OrdLine table because it does not include the entire primary
key. It may be updatable for the OrderTbl table because the view includes the primary key
and all required columns. The updatability depends on the particular DBMS.
12.
View3 is not updatable because it includes a GROUP BY clause.
11/20/2023 Answers to Chapter 10 Problems 6
13.
Oracle SQL:
INSERT INTO Chpt10_01
(ProdNo, ProdName,SuppNo,ProdQOH,ProdPrice,ProdNextShipDate)
VALUES
('P9999999', 'Any Company','S3399214',10,20,'5-Feb-2007')
/
Access SQL:
INSERT INTO Chpt10_01
(ProdNo, ProdName,SuppNo,ProdQOH,ProdPrice,ProdNextShipDate)
VALUES
('P9999999', 'Any Company','S3399214',10,20,#2/5/2007#)
14.
UPDATE Chpt10_01
SET ProdQOH = ProdQOH - 1
WHERE ProdNo = 'P9999999'
15.
DELETE FROM Chpt10_01
WHERE ProdNo = 'P9999999'
16. This CREATE VIEW statement prevents side effects. You cannot use the WITH
CHECK OPTION in SQL-92 mode in Microsoft Access.
17. This UPDATE statement should be rejected because it violates the WHERE condition of
the view definition.
UPDATE Chpt10_01A
SET SuppNo = 'S4420948'
WHERE ProdNo = 'P6677900'
/
11/20/2023 Answers to Chapter 10 Problems 7
18. Microsoft Access requires the join operator style for updatability. The CustNo foreign
key in the OrderTbl table must be in the result because OrderTbl is updatable. The columns
of the Customer table are required if those columns are updatable. To support insert
operations on the Customer table, its primary key (CustNo) also must be in the result.
19. Microsoft Access requires the join operator style for updatability. The CustNo and
EmpNo foreign keys in the OrderTbl table must be in the result because OrderTbl is
updatable. The LEFT JOIN is necessary because all OrderTbl rows should be in the result.
The columns of the Customer table are required if those columns are updatable. To support
insert operations on the Customer table, its primary key (CustNo) must be in the result.
20. Microsoft Access requires the join operator style for updatability. The OrdLine.ProdNo
column must be in the result because the OrdLine table is updatable. The columns of the
Product table are required if those columns are updatable. To support insert operations on
the Product table, its primary (ProdNo) must be in the result.
21. Microsoft Access requires the join operator style for updatability. The query must
include the primary key and required columns of the Purchase table (the child table)
because it is updatable. The updatable columns of the Supplier table (the parent table) must
be in the query result. If the query supports insert operations on the Supplier table, its
primary key must be in the query result.
22.
(1) OrderTbl-OrdLine is the 1-M relationship.
(2) OrderTbl.OrdNo and OrdLine.OrdNo are the linking columns.
(3) No other tables are needed.
(4) OrderTbl in the main form is updatable while OrdLine in the subform is updatable.
(5) Main Form query: SELECT * FROM OrderTbl
Subform query: SELECT * FROM OrdLine
11/20/2023 Answers to Chapter 10 Problems 8
23.
(1) OrderTbl-OrdLine is the 1-M relationship.
(2) OrderTbl.OrdNo and OrdLine.OrdNo are the linking columns.
(3) In the main form, the Customer and Employee tables also appear. In the subform, the
Product and Supplier tables also appear.
(4) OrderTbl in the main form is updatable while OrdLine in the subform is updatable.
The other tables are read-only (Product, Supplier, and Customer).
(5) In Access, 1-M updatable queries must use the join operator style. The one-sided
outer join is necessary to support Internet orders. In the subform query, the OrdNo
column must appear in the result even though it does not appear in the subform because it
is the linking column.
Subform query:
SELECT OrdLine.OrdNo, OrdLine.ProdNo, Product.ProdName, Product.SuppNo,
Supplier.SuppName, OrdLine.Qty, Product.ProdPrice,
Qty*ProdPrice AS Amount
FROM Supplier INNER JOIN (Product INNER JOIN OrdLine
ON Product.ProdNo = OrdLine.ProdNo)
ON Supplier.SuppNo = Product.SuppNo
24. The answers are identical to problem (23) except for the main form query. A join rather
than one-sided outer join should be used for the main form query because Web orders are
not supported. Thus, the revised main form query is:
25.
(1) Purchase-PurchLine is the 1-M relationship.
(2) Purchase.PurchNo and PurchLine.PurchNo are the linking columns.
(3) No other tables are needed.
(4) Purchase in the main form is updatable while PurchLine in the subform is updatable.
(5) Main Form query: SELECT * FROM Purchase
Subform query: SELECT * FROM PurchLine
26.
(1) Purchase-PurchLine is the 1-M relationship.
(2) Purchase.PurchNo and PurchLine.PurchNo are the linking columns.
(3) In the main form, the Supplier table also appears. In the subform, the Product table
also appears.
(4) Purchase in the main form is updatable while PurchLine in the subform is updatable.
The other tables are read-only (Product and Supplier).
(5) In Access, 1-M updatable queries must use the join operator style. In the subform
query, the PurchNo column must appear in the result even though it does not appear in
the subform because it is the linking column.
Subform query:
SELECT PurchLine.PurchNo, PurchLine.ProdNo, Product.ProdName,
Product.ProdQOH, PurchLine.PurchQty, PurchLine.PurchUnitCost,
Product.ProdPrice, PurchUnitCost*PurchQty AS Amount
FROM Product INNER JOIN PurchLine ON Product.ProdNo = PurchLine.ProdNo
27.
(1) Supplier-Product is the 1-M relationship.
(2) Supplier.SuppNo and Product.SuppNo are the linking columns.
(3) No other tables appear in either the main form or subform.
(4) Supplier in the main form is updatable while Product in the subform is updatable.
The subform supports manipulation of the ProdNo and ProdName columns only.
(5) In the subform query, the Product.SuppNo column must appear in the result even
though it does not appear in the subform because it is the linking column.
Subform query:
SELECT ProdNo, ProdName, SuppNo
FROM Product
28.
Access SQL:
SELECT OrderTbl.OrdNo, OrdDate, OrdLine.ProdNo, ProdName,
Qty, ProdPrice, Qty*ProdPrice AS Amount
FROM OrderTbl, OrdLine, Product
WHERE OrderTbl.OrdNo = OrdLine.OrdNo AND OrdLine.ProdNo = Product.ProdNo
AND OrdDate Between #1/1/2007# AND #1/31/2007#
AND CustNo = 'C2388597'
Oracle SQL:
SELECT OrderTbl.OrdNo, OrdDate, OrdLine.ProdNo, ProdName,
Qty, ProdPrice, Qty*ProdPrice AS Amount
FROM OrderTbl, OrdLine, Product
WHERE OrderTbl.OrdNo = OrdLine.OrdNo AND OrdLine.ProdNo = Product.ProdNo
AND OrdDate Between '1-Jan-2007' AND '31-Jan-2007'
AND CustNo = 'C2388597'
/
29. The SELECT statement contains OrdMonth to enable proper sorting in the report.
Access SQL:
SELECT Left(CustZip, 5) AS ShortZip, Month(OrdDate) AS OrdMonth,
format(OrdDate, "mmmm yyyy") AS OrdMonthYear,
COUNT(*) AS OrdLineCount, SUM(Qty*ProdPrice) AS OrderSum
FROM OrderTbl, OrdLine, Product, Customer
WHERE OrderTbl.OrdNo = OrdLine.OrdNo
AND OrdDate Between #1/1/2007# And #12/31/2007#
AND OrdLine.ProdNo = Product.ProdNo
AND OrderTbl.CustNo = Customer.CustNo
GROUP BY Left(CustZip, 5), Month(OrdDate), format(OrdDate, "mmmm yyyy")
Visit https://testbankdead.com
now to explore a rich
collection of testbank,
solution manual and enjoy
exciting offers!
11/20/2023 Answers to Chapter 10 Problems 11
Oracle SQL:
SELECT substr(CustZip, 1, 5) AS ShortZip, to_number(to_char(OrdDate, 'MM'))
AS OrdMonth, to_char(OrdDate, 'MONTH YYYY') AS OrdMonthYear,
COUNT(*) AS OrdLineCount, SUM(Qty*ProdPrice) AS OrderSum
FROM OrderTbl, OrdLine, Product, Customer
WHERE OrderTbl.OrdNo = OrdLine.OrdNo
AND OrdDate Between '1-Jan-2007' AND '31-Dec-2007'
AND OrdLine.ProdNo = Product.ProdNo
AND OrderTbl.CustNo = Customer.CustNo
GROUP BY substr(CustZip, 1, 5), to_number(to_char(OrdDate, 'MM')),
to_char(OrdDate, 'MONTH YYYY')
/
30. The following solutions include a two statement and a one statement solution. The one
statement solutions use a SELECT statement in the FROM clause.
31.
Access SQL:
SELECT Purchase.PurchNo, PurchDate, PurchLine.ProdNo, ProdName,
PurchQty AS [Quantity Purchased], PurchUnitCost AS Cost,
PurchQty*PurchUnitCost AS Amount
FROM Purchase, PurchLine, Product
WHERE Purchase.PurchNo = PurchLine.PurchNo
AND PurchLine.ProdNo = Product.ProdNo
AND PurchDate Between #2/1/2007# AND #2/28/2007#
AND Purchase.SuppNo = 'S5095332';
Oracle SQL:
SELECT Purchase.PurchNo, PurchDate, PurchLine.ProdNo, ProdName,
PurchQty AS QuantityPurchased, PurchUnitCost AS Cost,
PurchQty*PurchUnitCost AS Amount
FROM Purchase, PurchLine, Product
WHERE Purchase.PurchNo = PurchLine.PurchNo
AND PurchLine.ProdNo = Product.ProdNo
AND PurchDate Between '1-Feb-2007' AND '28-Feb-2007'
AND Purchase.SuppNo = 'S5095332';
11/20/2023 Answers to Chapter 10 Problems 14
32.
Access SQL:
SELECT mid(SuppPhone,2, 3) AS AreaCode, Month(PurchDate) AS PurchMonth,
format(PurchDate, "mmmm yyyy") AS PurchMonthYear,
COUNT(*) AS PurchLineCount,
SUM(PurchQty*PurchUnitCost) AS PurchSum
FROM Purchase, PurchLine, Product, Supplier
WHERE Purchase.PurchNo = PurchLine.PurchNo
AND PurchDate Between #1/1/2007# And #12/31/2007#
AND PurchLine.ProdNo = Product.ProdNo
AND Purchase.SuppNo = Supplier.SuppNo
GROUP BY mid(SuppPhone,2, 3), Month(PurchDate),
format(PurchDate, "mmmm yyyy")
Oracle SQL:
SELECT substr(SuppPhone,2, 3) AS AreaCode,
to_number(to_char(PurchDate, 'MM')) AS PurchMonth,
to_char(PurchDate, 'MONTH YYYY') AS PurchMonthYear,
COUNT(*) AS PurchLineCount,
SUM(PurchQty*PurchUnitCost) AS PurchSum
FROM Purchase, PurchLine, Product, Supplier
WHERE Purchase.PurchNo = PurchLine.PurchNo
AND PurchDate Between '1-Jan-2007' AND '31-Dec-2007'
AND PurchLine.ProdNo = Product.ProdNo
AND Purchase.SuppNo = Supplier.SuppNo
GROUP BY substr(SuppPhone,2, 3), to_number(to_char(PurchDate, 'MM')),
to_char(PurchDate, 'MONTH YYYY');
33. The following solutions include a two statement and a one statement solution. The one
statement solutions use a SELECT statement in the FROM clause.
testbankdeal.com