SlideShare a Scribd company logo
1 of 70
Suppose that a PRODUCT table contains two attributes,
PROD_CODE and VEND_CODE. Those two attributes have
values of ABC, 125, DEF, 124, GHI, 124, and JKL, 123,
respectively. The VENDOR table contains a single attribute,
VEND_CODE, with values 123, 124, 125, and 126,
respectively. (The VEND_CODE attribute in the PRODUCT
table is a foreign key to the VEND_CODE in the VENDOR
table.) Given that information, what would be the query output
for a INTERSECT query based on these two tables?
a. The query output will be: 125,124,123,126
b. The query output will be: 123
c. The query output will be: 125,124,124,123,123,124,125,126
d. The query output will be: 123,124,125
What is the difference between UNION and UNION ALL?
a. A UNION ALL operator will yield all rows of both relations,
including duplicates
b. UNION yields unique rows
c. UNION eliminates duplicates rows
d. All of these choices are correct.
A(n) ______________ is a block of PL/SQL code that is
automatically invoked by the DBMS upon the occurrence of a
data manipulation event (INSERT, UPDATE or DELETE.)
a. stored procedure
b. trigger
c. view
d. function
__________________ means that the relations yield attributes
with identical names and compatible data types.
a. duplicated
b. Set comparable
c. Union compatible
d. compatible-oriented
Which of the following a parts of the definition of a trigger?
a. The triggering level
b. The triggering action
c. The triggering timing
d. All of these choices are correct.
Which of the following relational set operators does NOT
require that the relations are union-compatible?
a. INTERSECT
b. PROJECT
c. MINUS
d. UNION
Suppose that you have two tables, EMPLOYEE and
EMPLOYEE_1. The EMPLOYEE table contains the records for
three employees: Alice Cordoza, John Cretchakov, and Anne
McDonald. The EMPLOYEE_1 table contains the records for
employees John Cretchakov and Mary Chen. Given that
information, what is the query output for the INTERSECT
query?
a. The query output will be: John Cretchakov and Mary Chen
b. The query output will be: Alice Cordoza, John Cretchakov,
Anne McDonald and Mary Chen
c. The query output will be: John Cretchakov
d. The query output will be: Alice Cordoza, John Cretchakov,
Anne McDonald, John Cretchakov and Mary Chen
A _____________________ is a join that performs a relational
product (or Cartesian product) of two tables.
a. CROSS JOIN
b. DUPLICATE JOIN
c. OUTER JOIN
d. INNER JOIN
What Oracle function should you use to calculate the number of
days between the current date and January 25, 1999?
a. SELECT SYSDATE()-#25-JAN-1999#;
b. SELECT SYSDATE – TO_DATE('25-JAN-1999', 'DD-MON-
YYYY') FROM DUAL;
c. SELECT SYSDATE FROM DUAL;
d. SELECT SYSDATE()-JAN-#25-1999#;
Using tables named T1 and T2, write a query example for a
LEFT OUTER JOIN, assuming that T1 and T2 share a common
column named C1.
a. SELECT * FROM T1 OUTER JOIN T2 ON T1.C1 = T2.C2;
b. SELECT * FROM T1 JOIN T2 ON T2.C1 = T2.C1;
c. SELECT * FROM T1 LEFT JOIN T2 ON T1.C1 = T2.C1;
d. SELECT * FROM T1 LEFT OUTER JOIN T2 ON T1.C1 =
T2.C1;
Suppose that you have two tables, EMPLOYEE and
EMPLOYEE_1. The EMPLOYEE table contains the records for
three employees: Alice Cordoza, John Cretchakov, and Anne
McDonald. The EMPLOYEE_1 table contains the records for
employees John Cretchakov and Mary Chen. Given that
information, what is the query output for the MINUS query
(specifically, SELECT * FROM EMPLOYEE MINUS SELECT
* FROM EMPLOYEE_1)?
a. The query output will be: Alice Cordoza, John Cretchakov,
Anne McDonald and Mary Chen
b. The query output will be: Alice Cordoza, John Cretchakov,
Anne McDonald, John Cretchakov and Mary Chen
c. The query output will be: Mary Chen
d. The query output will be: Alice Cordoza and Anne McDonald
What Oracle function should you use to return the current date?
a. TODAY
b. SYSDATE
c. NOW
Suppose that a PRODUCT table contains two attributes,
PROD_CODE and VEND_CODE. Those two attributes have
values of ABC, 125, DEF, 124, GHI, 124, and JKL, 123,
respectively. The VENDOR table contains a single attribute,
VEND_CODE, with values 123, 124, 125, and 126,
respectively. (The VEND_CODE attribute in the PRODUCT
table is a foreign key to the VEND_CODE in the VENDOR
table.) Given that information, what would be the query output
for a UNION ALL query based on these two tables?
a. The query output will be: 125,124,124,123,123,124,125,126
b. The query output will be: 125,124,124,123
c. The query output will be: 125,124,123,126
d. The query output will be: 123
_________________is a term used to refer to SQL statements
that are contained within an application programming language
such as COBOL, C++, ASP, Java, or ColdFusion.
a. NoSQL
b. Embedded SQL
c. Dynamic SQL
The order of the operands (tables) matter in a _______ query.
a. PROJECT
b. MINUS
c. UNION
d. INTERSECT
Which of the following is true of Oracle sequences?
a. You can have as many sequences as you want and they are
not tied to any particular table.
b. A sequence is a completely independent object.
c. The sequence-generated value is not tied to any field in any
table and can, therefore, be used on any attribute in any table.
Which of the following is true of Oracle sequences?
a. You can have as many sequences as you want and they are
not tied to any particular table.
b. A sequence is a completely independent object.
c. The sequence-generated value is not tied to any field in any
table and can, therefore, be used on any attribute in any table.
d. All of these choices are correct.
A(n) ______________ is a named collection of procedural and
SQL statements that are stored in the database and that can be
used to encapsulate and represent business transactions.
a. trigger
b. stored procedure
c. view
Suppose that you have two tables, EMPLOYEE and
EMPLOYEE_1. The EMPLOYEE table contains the records for
three employees: Alice Cordoza, John Cretchakov, and Anne
McDonald. The EMPLOYEE_1 table contains the records for
employees John Cretchakov and Mary Chen. Given that
information, what is the query output for the UNION query?
a. The query output will be: Alice Cordoza, John Cretchakov,
Anne McDonald and Mary Chen
b. The query output will be: John Cretchakov and Mary Chen
c. The query output will be: Alice Cordoza, John Cretchakov,
Anne McDonald, John Cretchakov and Mary Chen
d. The query output will be: John Cretchakov
A subquery can appear in which of the following places in a
SQL statement?
a. as part of a FROM clause,
b. to the right of a HAVING clause conditional operator,
c. in a EXISTS operator,
d. All of these choices are correct.
A __________ is a query (expressed as a SELECT statement)
that is located inside another query and is normally executed
first.
a. multi-query
b. subquery
c. outside query
d. special query
What string function (in Oracle) should you use to list the first
three characters of a company's EMP_LNAME values using a
table named EMPLOYEE?
a. SELECT STR(EMP_LNAME, 1, 3) FROM EMPLOYEE;
b. SELECT STRING(EMP_LNAME, 1, 3) FROM EMPLOYEE;
c. SELECT SUBSTRING(EMP_LNAME, 1, 3) FROM
EMPLOYEE;
d. SELECT SUBSTR(EMP_LNAME, 1, 3) FROM EMPLOYEE;
_____________ is a term used to describe an environment in
which the SQL statement is not known in advance; instead, the
SQL statement is generated at run time.
a. PL/SQL
b. Embedded SQL
c. Dynamic SQL
d. NoSQL
Suppose that a PRODUCT table contains two attributes,
PROD_CODE and VEND_CODE. Those two attributes have
values of ABC, 125, DEF, 124, GHI, 124, and JKL, 123,
respectively. The VENDOR table contains a single attribute,
VEND_CODE, with values 123, 124, 125, and 126,
respectively. (The VEND_CODE attribute in the PRODUCT
table is a foreign key to the VEND_CODE in the VENDOR
table.) Given that information, what would be the query output
for a MINUS query (VENDOR MINUS PRODUCT) based on
these two tables?
a. The query output will be: 124
b. The query output will be: 125,124,123,126
c. The query output will be: NULL
d. The query output will be: 126
In the relational model, SQL operators are ________________
because they operate over entire sets of rows and columns (or
tables) at once.
a. set-oriented
b. table-oriented
c. completeness-oriented
Which of the followings explains the difference between a
regular subquery and a correlated subquery?
a. A correlated subquery will execute once for each row
evaluated by the outer query
b. A regular subquery executes only once and the result is held
for use by the outer query
c. A regular subquery executes before the outer query
d. All of these choices are correct.
If you do not specify a join condition when joining tables, the
result will be a ______________ or PRODUCT operation.
a. CROSS JOIN
b. DUPLICATE JOIN
c. INNER JOIN
d. OUTER JOIN
A ______________ is a subquery that executes once for each
row in the outer query; it will run the outer query first, and then
it will run the inner subquery once for each row returned in the
outer subquery.
a. outside subquery
b. uncorrelated subquery
c. correlated subquery
A relational view has which of the following characteristics?
a. views are dynamically updated
b. views may be used as the basis for reports or queries, just
like tables
c. views provide a level of security in the database
A(n) ______________ is a special type of object that generates
unique numeric values in ascending or descending order; it can
be used to assign values to a primary key field in a table and it
provides functionality similar to the Autonumber data type in
MS Access.
a. sequence
b. key
c. instance
d. view
which of the following is NOT considered an advantage of a
stored procedure?
a. Increase performance
b. Help reduce code duplication through code isolation and code
sharing
c. Reduce network traffic
d. None of these choices are correct.
What are the types of results a subquery can return?
a. a list of values only
b. a single value, a list of values, or a virtual table
c. a single value only
d. a virtual table only
The SQL standard prescribes three different types of
__________ operations: LEFT, RIGHT, and FULL.
a. OUTER join
b. INNER join
c. DUPLICATE join
A(n) __________________ is a type of JOIN operation that
yields all rows with matching values in the join columns as well
as all unmatched rows ( those without matching values in the
join columns).
a. INNER JOIN
b. OUTER JOIN
c. CROSS JOIN
d. DUPLICATE JOIN
Suppose that a PRODUCT table contains two attributes,
PROD_CODE and VEND_CODE. Those two attributes have
values of ABC, 125, DEF, 124, GHI, 124, and JKL, 123,
respectively. The VENDOR table contains a single attribute,
VEND_CODE, with values 123, 124, 125, and 126,
respectively. (The VEND_CODE attribute in the PRODUCT
table is a foreign key to the VEND_CODE in the VENDOR
table.) Given that information, what would be the query output
for a UNION query based on these two tables?
a. The query output will be: 123,124,125,126
b. The query output will be: 125,124,124,123
c. The query output will be: 125,124,123,126
d. The query output will be: 123
Triggers are critical to proper database operation and
management in which of the following ways?
a. add functionality by automating critical actions and providing
appropriate warnings for remedial action.
b. used to enforce constraints that cannot be enforced at the
DBMS design and implementation levels.
c. can be used to enforce referential integrity, to update table
values, insert records in tables, and call other stored procedures.
d. All of these choices are correct.
A(n) ________ is a virtual table based on a SELECT query.
a. view
b. copy
c. schema
Suppose that you have two tables, EMPLOYEE and
EMPLOYEE_1. The EMPLOYEE table contains the records for
three employees: Alice Cordoza, John Cretchakov, and Anne
McDonald. The EMPLOYEE_1 table contains the records for
employees John Cretchakov and Mary Chen. Given that
information, what is the query output for the UNION ALL
query?
a. The query output will be: Alice Cordoza, John Cretchakov,
Anne McDonald and Mary Chen
b. The query output will be: John Cretchakov and Mary Chen
c. The query output will be: John Cretchakov
d. The query output will be: Alice Cordoza, John Cretchakov,
Anne McDonald, John Cretchakov and Mary Chen
The ______________________ will yield all rows with
matching values in the join columns, plus all of the unmatched
rows from the right table.
a. CENTER OUTER JOIN
b. RIGHT OUTER JOIN
c. LEFT OUTER JOIN
d. FULL OUTER JOIN
Use the following scenario for questions from this chapter:
You have been given a database for a small charity used to track
donations made to it. It has the following structure:
and the following sample data in the tables:
Donor
Donor_Id
Donor_
FirstName
Donor_
LastName
Donor_Address
Donor_City
Donor_State
Donor_ZipCode
Donor_Phone
Donor_Email
101
James
James
123 Mockingbird Place
Peoria
IL
55556
555-555-2342
[email protected]
175
Joseph
Mays
54321 7th St
Atlantic City
NJ
15678
555-555-9877
[email protected]
207
Susan
Ames
777 Main St
Burlington
KY
41098
555-555-3478
[email protected]
303
Nancy
Zornes
P.O. Box 88776
Peoria
IL
55578-8776
555-555-1255
[email protected]
ReceiptType
ReceiptType_Id
ReceiptType_Description
C
Cash
CK
Check/Money Order
CC
Credit Card
PD
Payroll Deduction
A
Art / Collectible
I
In-kind
Fund
Fund_Id
Fund_Name
G
General Operation
S
Scholarship
B
Building Maintenance
C
Capital Campaign
Receipt
Receipt_Id
Donor_Id
Receipt_Date
ReceiptType_Id
Fund_Id
Receipt_Amount
Receipt_Description
1001
101
2015-01-05
CK
G
100
1002
207
2015-01-05
C
S
250
For: Virginia Wolfe Wilde
1003
207
2015-01-05
C
B
100
1004
175
2015-01-06
CC
G
137.5
In Memory of Bob
1005
101
2015-02-14
CK
G
100
1006
175
2015-02-20
A
C
15000000
Picasso Painting
For reporting purposes the client would like you to create a
temporary table called “FundSummary” that contains the fund
id, donor id, the number of receipts (donations) made to the
fund by a donor, and the total of the receipts and the donor. The
new table from the sample data would look like:
B
207
1
100
C
175
1
15000000
G
101
2
200
G
175
1
137.5
S
207
1
250
Fill in the blanks of the SQL Statements:
Fund_Id VARCHAR(10) ,
Donor_id VARCHAR(10) ,
Count_Of_Receipts INTEGER,
Total_Receipts DECIMAL(10,2),
(Fund_Id, Donor_Id),
FOREIGN KEY (Donor_Id) REFERENCES ( ),
FOREIGN KEY ( ) REFERENCES (Fund_Id) );
INSERT INTO FundSummary
Fund_Id, Donor_Id, (Receipt_Id), ( )
FROM Receipt
Fund_Id, ;
Fill in the blanks with words that would best complete the
passage.
donor_id
FundSummary
receipt_amount
(
not
null
select
sum
donor_id
primary
by
group
CREATE
key
donor
not
fund_id
fund
count
null
TABLE
Use the following scenario for questions from this chapter:
You have been given a database for a small charity used to track
donations made to it. It has the following structure:
and the following sample data in the tables:
Donor
Donor_Id
Donor_
FirstName
Donor_
LastName
Donor_Address
Donor_City
Donor_State
Donor_ZipCode
Donor_Phone
Donor_Email
101
James
James
123 Mockingbird Place
Peoria
IL
55556
555-555-2342
[email protected]
175
Joseph
Mays
54321 7th St
Atlantic City
NJ
15678
555-555-9877
[email protected]
207
Susan
Ames
777 Main St
Burlington
KY
41098
555-555-3478
[email protected]
303
Nancy
Zornes
P.O. Box 88776
Peoria
IL
55578-8776
555-555-1255
[email protected]
ReceiptType
ReceiptType_Id
ReceiptType_Description
C
Cash
CK
Check/Money Order
CC
Credit Card
PD
Payroll Deduction
A
Art / Collectible
I
In-kind
Fund
Fund_Id
Fund_Name
G
General Operation
S
Scholarship
B
Building Maintenance
C
Capital Campaign
Receipt_Id
Donor_Id
Receipt_Date
ReceiptType_Id
Fund_Id
Receipt_Amount
Receipt_Description
1001
101
2015-01-05
CK
G
100
1002
207
2015-01-05
C
S
250
For: Virginia Wolfe Wilde
1003
207
2015-01-05
C
B
100
1004
175
2015-01-06
CC
G
137.5
In Memory of Bob
1005
101
2015-02-14
CK
G
100
1006
175
2015-02-20
A
C
15000000
Picasso Painting
Receipt
The client wants a listing of donor id, last name, first name,
receipt date, type, and amount for all receipts greater than
$100.00. The client wants the result sorted by donor last name,
first name, and the donation date. The query result from the
sample data would look like:
207
Ames
Susan
2015-01-05
C
250
175
Mays
Joseph
2015-01-06
CC
137.5
175
Mays
Joseph
2015-02-20
A
15000000
Fill in the blanks of the SQL Statement:
Donor. , Donor_LastName, Donor_FirstName,
Receipt_Date,
Receipt.ReceiptType_Id, Receipt_Amount
Receipt
Receipt.Donor_Id =
Receipt_Amount 100.00
Donor_LastName, Donor_FirstName,
Receipt_Date;
Fill in the blanks with words that would best complete the
passage.
from
>
donor.donor_id
select
donor
where
and
order
by
donor_id
,
The problems for this chapter use a database for a simple
department store that sells items to customers and wants to keep
track of the invoices, the selling price (if an item is on sale),
and the sales tax (7%) to be collected on some items. Every
customer and invoice are assigned unique numbers. All items
have a Universal Product Code (UPC) number and bar-code
assigned to each unique item. Food and non-carbonated
beverages are not taxed, but clothing, home goods, and most
other items are.
The structure of the tables are described in the following crows
foot ERD:
Sample Data for the tables follow:
Customer
Customer_Id
Customer_
FirstName
Customer_
LastName
Customer_
Address
Customer_
City
Customer_
State
Customer_
ZipCode
Customer_
Phone
Customer_Email
342
Linda
Spangler
2323 Roanoke Pk
Floyd
VA
24987
555-555-5646
[email protected]
505
Rodney
Ray
12399 27th Ave
New York
NY
10097
555-555-0909
[email protected]
776
Nancy
Reno
P.O.Box 98
Carter City
KY
41155
555-555-2342
[email protected]
987
Gustov
Jones
333 East Main St
Jamestown
VA
23099
555-555-9876
[email protected]
ItemType
ItemType_Id
ItemType_Description
W
Woman's Clothing
M
Men's Clothing
WA
Woman's Accessories
MA
Men's Accessories
A
General Accessories
O
Other
ItemSize
ItemSize_Id
ItemSize_Description
XS
Extra Small
S
Small
M
Medium
L
Large
XL
Extra Large
Item
UPC
Item_Description
ItemType_Id
ItemSize_Id
Item_Price
Item_Taxable
012345234569
Cream Blouse
W
S
29.95
1
012345234576
Cream Blouse
W
M
29.95
1
012345234588
Cream Blouse
W
L
29.95
1
012345234590
Cream Blouse
W
XL
29.95
1
012345234468
Blue Blouse
W
S
29.95
1
012345234475
Blue Blouse
W
M
29.95
1
012345234491
Blue Blouse
W
XL
29.95
1
012345224889
12 Inch Pearl Necklace
WA
345.95
1
012345224126
10 Inch Pearl Necklace
WA
298.95
1
012345334678
Explorer Cargo Shorts
M
S
33.45
1
012345334734
Explorer Cargo Shorts
M
M
33.45
1
012345334795
Explorer Cargo Shorts
M
L
33.45
1
012345334889
Explorer Cargo Shorts
M
XL
33.45
1
012345335101
Pink Silk Tie
MA
67.55
1
012345335303
Pink and Green Silk Tie
MA
67.55
1
012345999001
Yummy Bottled Water
O
1.29
0
Invoice
Invoice_Number
Customer_Id
Invoice_Date
Invoice_Taxable
Invoice_NonTaxable
Invoice_SalesTax
Invoice_Total
10101
987
2015-07-27
29.95
2.58
2.1
34.63
10102
505
2015-07-27
33.45
0
2.34
35.79
10107
505
2015-07-28
59.99
1.29
4.2
65.48
10111
342
2015-07-28
262.89
0
18.4
281.29
InvoiceDetail
Invoice_Number
UPC
Detail_Quantity
Detail_RegularPrice
Detail_SellingPrice
10101
012345334795
1
33.45
29.95
10101
012345999001
2
1.29
1.29
10102
012345334889
1
33.45
33.45
10107
012345335303
1
67.55
59.99
10107
012345999001
1
1.29
1.29
10111
012345234576
1
29.95
29.95
10111
012345234475
1
29.95
29.95
10111
012345224126
1
298.95
202.99
Suppose that we have a second table with vendor information
(sample is below) in it and that we want to create a single
telephone directory with both vendor and customer information
in it.
Vendor_Id
Vendor_CompanyName
Vendor_Address
Vendor_City
Vendor_State
Vendor_ZipCode
Vendor_Phone
Vendor_Email
101
QRS Importers
12345 Dock St
San Fransisco
CA
97654
555-544-4444
[email protected]
505
ABC Supply
505 Euclid Ave
Lexington
KY
40505
555-505-0505
[email protected]
The phone directory should contain the state, a name column
with either the customer last name and first name concatenated
with a comma or the vendor company name, city, and phone
number. Output should be sorted by state then by name. Your
results should look like:
State
Name
City
Phone
CA
QRS Importers
San Fransisco
555-544-4444
KY
ABC Supply
Lexington
555-505-0505
KY
Reno, Nancy
Carter City
555-555-2342
NY
Ray, Rodney
New York
555-555-0909
VA
Jones, Gustov
Jamestown
555-555-9876
VA
Spangler, Linda
Floyd
555-555-5646
Fill in the blanks (remember a blank, drop "blank" as answer)
SELECT , , ,
FROM ( SELECT || ', ' || Customer_FirstName AS Name,
Customer_City , Customer_State AS State,
Customer_Phone AS Phone
FROM Customer
SELECT Vendor_CompanyName AS Name,
Vendor_City AS City, Vendor_State AS State, Vendor_Phone
AS Phone
FROM Vendor )
State, Name;
Fill in the blanks with words that would best complete the
passage.
blank
Phone
city
City
Customer_LastName
blank
Name
AS
BY
UNION
State
ORDER
The problems for this chapter use a database for a simple
department store that sells items to customers and wants to keep
track of the invoices, the selling price (if an item is on sale),
and the sales tax (7%) to be collected on some items. Every
customer and invoice are assigned unique numbers. All items
have a Universal Product Code (UPC) number and bar-code
assigned to each unique item. Food and non-carbonated
beverages are not taxed, but clothing, home goods, and most
other items are.
The structure of the tables are described in the following crows
foot ERD:
Sample Data for the tables follow:
Customer
Customer_Id
Customer_
FirstName
Customer_
LastName
Customer_
Address
Customer_
City
Customer_
State
Customer_
ZipCode
Customer_
Phone
Customer_Email
342
Linda
Spangler
2323 Roanoke Pk
Floyd
VA
24987
555-555-5646
[email protected]
505
Rodney
Ray
12399 27th Ave
New York
NY
10097
555-555-0909
[email protected]
776
Nancy
Reno
P.O.Box 98
Carter City
KY
41155
555-555-2342
[email protected]
987
Gustov
Jones
333 East Main St
Jamestown
VA
23099
555-555-9876
[email protected]
ItemType
ItemType_Id
ItemType_Description
W
Woman's Clothing
M
Men's Clothing
WA
Woman's Accessories
MA
Men's Accessories
A
General Accessories
O
Other
ItemSize
ItemSize_Id
ItemSize_Description
XS
Extra Small
S
Small
M
Medium
L
Large
XL
Extra Large
Item
UPC
Item_Description
ItemType_Id
ItemSize_Id
Item_Price
Item_Taxable
012345234569
Cream Blouse
W
S
29.95
1
012345234576
Cream Blouse
W
M
29.95
1
012345234588
Cream Blouse
W
L
29.95
1
012345234590
Cream Blouse
W
XL
29.95
1
012345234468
Blue Blouse
W
S
29.95
1
012345234475
Blue Blouse
W
M
29.95
1
012345234491
Blue Blouse
W
XL
29.95
1
012345224889
12 Inch Pearl Necklace
WA
345.95
1
012345224126
10 Inch Pearl Necklace
WA
298.95
1
012345334678
Explorer Cargo Shorts
M
S
33.45
1
012345334734
Explorer Cargo Shorts
M
M
33.45
1
012345334795
Explorer Cargo Shorts
M
L
33.45
1
012345334889
Explorer Cargo Shorts
M
XL
33.45
1
012345335101
Pink Silk Tie
MA
67.55
1
012345335303
Pink and Green Silk Tie
MA
67.55
1
012345999001
Yummy Bottled Water
O
1.29
0
Invoice
Invoice_Number
Customer_Id
Invoice_Date
Invoice_Taxable
Invoice_NonTaxable
Invoice_SalesTax
Invoice_Total
10101
987
2015-07-27
29.95
2.58
2.1
34.63
10102
505
2015-07-27
33.45
0
2.34
35.79
10107
505
2015-07-28
59.99
1.29
4.2
65.48
10111
342
2015-07-28
262.89
0
18.4
281.29
InvoiceDetail
Invoice_Number
UPC
Detail_Quantity
Detail_RegularPrice
Detail_SellingPrice
10101
012345334795
1
33.45
29.95
10101
012345999001
2
1.29
1.29
10102
012345334889
1
33.45
33.45
10107
012345335303
1
67.55
59.99
10107
012345999001
1
1.29
1.29
10111
012345234576
1
29.95
29.95
10111
012345234475
1
29.95
29.95
10111
012345224126
1
298.95
202.99
You have been tasked to generate a report from the database
using a single SQL statement to do the following:
List all items with the number of invoices that the items have
been on and the total of the sales of that item. Display in order
by type, description, and size.
Your generated output should look like:
UPC
Item_Description
ItemType_Id
ItemSize_Id
Invoice_Count
Total_Sales
012345334795
Explorer Cargo Shorts
M
L
1
1
012345334734
Explorer Cargo Shorts
M
M
0
012345334678
Explorer Cargo Shorts
M
S
0
012345334889
Explorer Cargo Shorts
M
XL
1
1
012345335101
Pink Silk Tie
MA
0
012345335303
Pink and Green Silk Tie
MA
1
1
012345999001
Yummy Bottled Water
O
2
3
012345234475
Blue Blouse
W
M
1
1
012345234468
Blue Blouse
W
S
0
012345234491
Blue Blouse
W
XL
0
012345234588
Cream Blouse
W
L
0
012345234576
Cream Blouse
W
M
1
1
012345234569
Cream Blouse
W
S
0
012345234590
Cream Blouse
W
XL
0
012345224126
10 Inch Pearl Necklace
WA
1
1
012345224889
12 Inch Pearl Necklace
WA
0
Fill in the blanks (remember a blank, drop "blank" as answer)
SELECT Item.UPC, Item.Item_Description, Item.ItemType_Id,
Item.ItemSize_Id, COUNT(Invoice.Invoice_Number) AS
Invoice_Count,
SUM(InvoiceDetail.Detail_Quantity) AS Total_Sales
FROM item
InvoiceDetail ON item. = .UPC
Invoice ON .Invoice_Number =
InvoiceDetail.
GROUP BY Item.UPC
ORDER BY Item.ItemType_id, Item.Item_Description,
Item.ItemSize_Id;
Fill in the blanks with words that would best complete the
passage.
InvoiceDetail
LEFT
JOIN
blank
UPC
LEFT
Invoice
Invoice_Number
JOIN
Which of the following is the data dictionary's function in
database design?
a. It makes it easier to check for the existence of synonyms and
homonyms, to check whether all attributes exist to support
required reports, to verify appropriate relationship
representations, and so on.
b. Its contents are both developed and used during the six DBLC
phases.
c. It provides a precise description of the characteristics of all
the entities and attributes found within the database.
d. All of these choices are correct.
In the decentralized conceptual database design approach, the
aggregation process requires the lead designer to assemble a
single model where which of the following aggregation
problems must be addressed?
a. synonyms
b. entity subclasses
c. conflicting object definitions
d. All of these choices are correct.
______________ design begins by identifying the different
entity types and the definition of each entity's attributes.
a. Bottom up
b. Over the top
c. Top down
d. None of these choices are correct.
_______________ is the last stage in the database design
process.
a. Conceptual design
b. Database design
c. Physical design
d. Logical design
Which conceptual database design is best suited to relatively
small and simple databases that lend themselves well to a bird's
eye view of the entire database and may be designed by a single
person or by a small and informally constituted design team?
a. Centralized database design
b. Distributed database design
c. Decentralized database design
d. Top-down database design
A(n) ________________________ is a system that provides for
data collection, storage, and retrieval; facilitates the
transformation of data into information; and manages both data
and information. It is composed of hardware, the DBMS and
other software, database(s), people, and procedures.
a. information system
b. storage system
c. software system
d. database system
____________are narrative descriptions of the business
policies, procedures, or principles that are derived from a
detailed description of operations.
a. Entity rules
b. Database rules
c. Attribute rules
d. Business rules
The DBLC is composed of _____ phases.
a. four
b. six
c. three
d. five
Business rules are particularly valuable to database designers,
because they help define which of the following?
a. attributes
b. relationships
c. entities
d. All of these choices are correct.
The _________________ goal is to design an enterprise-wide
database that is based on a specific data model but independent
of physical-level details.
a. conceptual design
b. database design
c. physical design
d. logical design
Which of the following is NOT a step performed in the physical
design stage in the database design process?
a. Validate the model integrity constraints
b. Determine performance measurements
c. Define integrity and security measures
d. Define data storage organization
Which of the following is established during the systems design
phase, in which the designer completes the design of all
required system processes?
a. The database schema
b. The detailed system specifications
c. The user interface
d. None of these choices are correct.
Which of the following is established during the systems design
phase, in which the designer completes the design of all
required system processes?
a. The database schema
b. The detailed system specifications
c. The user interface
d. None of these choices are correct.
The conceptual design is composed of _____ steps.
a. seven
b. five
c. four
d. three
Ultimately, the purpose of an _____________________ is to
facilitate good decision making by making relevant and timely
information available to the decision makers.
a. information system
b. database system
c. software system
d. storage system
Which conceptual database design is best when company
operations are spread across multiple operational sites or when
the database has multiple entities that are subject to complex
relations?
a. Distributed database design
b. Top-down database design
c. Centralized database design
d. Decentralized database design
SDLC is the acronym that is used to label the
_______________________________.
a. System Design Life Cycle
b. System Development Life Cycle
c. Software Design Life Cycle
d. Software Development Life Cycle
A(n) ______________________ backup of the database creates
a backup of only those database objects that have changed since
the last full backup.
a. differential
b. partial
c. complete
d. transaction
Which of the following shows how systems analysis fits into a
discussion about information systems?
a. By evaluating the existing system
b. By developing a logical systems design
c. By establishing end-user requirements
d. All of these choices are correct.
DBLC is the acronym that is used to label the
_______________________________.
a. Database Life Cycle
b. Development Logical Cycle
c. Database Logical Cycle
d. Development Life Cycle
The SDLC is composed of _____ phases.
a. four
b. three
c. seven
d. five
Which of the following is NOT a step performed in the logical
design stage in the database design process?
a. Validate the model using normalization
b. Validate the model using user requirements
c. Validate the model integrity constraints
d. None of these choices are correct.
A(n) _____________ is the use of different names to identify
the same object, such as an entity, an attribute, or a
relationship.
a. synonym
b. pseudonym
c. homonym
d. antonym
Database design must yield a database that does which of the
following?
a. does not fall prey to uncontrolled data duplication, thus
preventing data anomalies and the attendant lack of data
integrity.
b. is efficient in its provision of data access.
c. serves the needs of the information system.
d. All of these choices are correct.
__________ design first defines the required attributes and then
groups the attributes to form entities.
a. Bottom up
b. Top down
c. Over the top
d. None of these choices are correct.
The ___________________ specifies that all the data defined in
the data model are actually required to fit present and expected
future data requirements.
a. completeness data rule
b. maximum data rule
c. multiple data rule
d. minimal data rule
Which of the following is NOT one of the six (6) steps
identified as part of the ER model verification process?
a. Verify all processes against the system requirements
b. Identify each module and its components
c. Identify the ER model's central entity
d. Map the entity names to proper process names
How many steps are required in the development of the
conceptual model using an ER diagram?
a. six
b. seven
c. eight
d. two
Which of the following is NOT an important factor in the
selection of a DBMS software product?
a. DBMS features and tools
b. Cost
c. Portability
d. Number of employees
2.Each of the following activities are commonly performed
during the implementation of the Database Life Cycle (DBLC).
Fill in the blank, before each activity, with the phase number of
the DBLS that this activity would normally be performed.
DBLC Task Numbers:
1. Database initial study
2. Database design
3. Implementation and loading
4. Testing and evaluation
5. Operation
6. Maintenance and evolution
Load the initial values into the tables
Finish user documentation
Adding additional tables, attributes, and indexes
Attempt to gain unauthorized access to the data
Interview management
Convert existing data
Study the competition's database
Plan how to grant different levels of access to different user
groups
Install the database
Train users
Changing constraints to match changes in business rules
Define budget and scope
Select a DBMS software solution
Draw a logical ERD
Performing software patches to the DBMS
Create the database
Understand how this database will connect to other databases
in the organization
Develop a Conceptual Model
Make sure application software updates the database
Regular security audits
Define objectives
Create a detailed model that can be physically implemented
Top of Form
Bottom of Form

More Related Content

Similar to Suppose that a PRODUCT table contains two attributes, PROD_CODE an.docx

Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperInformatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperHarish Gyanani
 
Preparing for BIT – IT2301 Database Management Systems 2001f
Preparing for BIT – IT2301 Database Management Systems 2001fPreparing for BIT – IT2301 Database Management Systems 2001f
Preparing for BIT – IT2301 Database Management Systems 2001fGihan Wikramanayake
 
Advanced plsql mock_assessment
Advanced plsql mock_assessmentAdvanced plsql mock_assessment
Advanced plsql mock_assessmentSaurabh K. Gupta
 
Redo midterm
Redo midtermRedo midterm
Redo midtermIIUM
 
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12chinthala Vijaya Kumar
 
FINAL PAPER FP304 DATABASE SYSTEM
FINAL PAPER FP304 DATABASE SYSTEMFINAL PAPER FP304 DATABASE SYSTEM
FINAL PAPER FP304 DATABASE SYSTEMAmira Dolce Farhana
 
Sample Paper Class XI (Informatics Practices)
Sample Paper Class XI (Informatics Practices)Sample Paper Class XI (Informatics Practices)
Sample Paper Class XI (Informatics Practices)Poonam Chopra
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxmaxinesmith73660
 
284566820 1 z0-061(1)
284566820 1 z0-061(1)284566820 1 z0-061(1)
284566820 1 z0-061(1)panagara
 
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAINFP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAINSyahriha Ruslan
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And AnswerJagan Mohan Bishoyi
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answerlavparmar007
 
xii-ip-support-material.pdf
xii-ip-support-material.pdfxii-ip-support-material.pdf
xii-ip-support-material.pdfkajalkhorwal106
 
Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...
Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...
Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...TAISEEREISA
 
IP Sample paper 2 Class XI
IP Sample paper 2 Class XI IP Sample paper 2 Class XI
IP Sample paper 2 Class XI Poonam Chopra
 
Primilimnary round questions with answers
Primilimnary round questions with answersPrimilimnary round questions with answers
Primilimnary round questions with answersDr. C.V. Suresh Babu
 
Computer science ms
Computer science msComputer science ms
Computer science msB Bhuvanesh
 

Similar to Suppose that a PRODUCT table contains two attributes, PROD_CODE an.docx (20)

Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperInformatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
 
Preparing for BIT – IT2301 Database Management Systems 2001f
Preparing for BIT – IT2301 Database Management Systems 2001fPreparing for BIT – IT2301 Database Management Systems 2001f
Preparing for BIT – IT2301 Database Management Systems 2001f
 
Advanced plsql mock_assessment
Advanced plsql mock_assessmentAdvanced plsql mock_assessment
Advanced plsql mock_assessment
 
Redo midterm
Redo midtermRedo midterm
Redo midterm
 
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
 
FINAL PAPER FP304 DATABASE SYSTEM
FINAL PAPER FP304 DATABASE SYSTEMFINAL PAPER FP304 DATABASE SYSTEM
FINAL PAPER FP304 DATABASE SYSTEM
 
Sample Paper Class XI (Informatics Practices)
Sample Paper Class XI (Informatics Practices)Sample Paper Class XI (Informatics Practices)
Sample Paper Class XI (Informatics Practices)
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
 
284566820 1 z0-061(1)
284566820 1 z0-061(1)284566820 1 z0-061(1)
284566820 1 z0-061(1)
 
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAINFP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
 
50058334 informatica
50058334 informatica50058334 informatica
50058334 informatica
 
1 z1 051
1 z1 0511 z1 051
1 z1 051
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And Answer
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
 
xii-ip-support-material.pdf
xii-ip-support-material.pdfxii-ip-support-material.pdf
xii-ip-support-material.pdf
 
Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...
Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...
Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...
 
IP Sample paper 2 Class XI
IP Sample paper 2 Class XI IP Sample paper 2 Class XI
IP Sample paper 2 Class XI
 
Primilimnary round questions with answers
Primilimnary round questions with answersPrimilimnary round questions with answers
Primilimnary round questions with answers
 
Computer science ms
Computer science msComputer science ms
Computer science ms
 
Java 1-contd
Java 1-contdJava 1-contd
Java 1-contd
 

More from picklesvalery

NPV, IRR, Payback period,— PA1Correlates with CLA2 (NPV portion.docx
NPV, IRR, Payback period,— PA1Correlates with CLA2 (NPV portion.docxNPV, IRR, Payback period,— PA1Correlates with CLA2 (NPV portion.docx
NPV, IRR, Payback period,— PA1Correlates with CLA2 (NPV portion.docxpicklesvalery
 
Now that you have had the opportunity to review various Cyber At.docx
Now that you have had the opportunity to review various Cyber At.docxNow that you have had the opportunity to review various Cyber At.docx
Now that you have had the opportunity to review various Cyber At.docxpicklesvalery
 
Now that you have completed a series of assignments that have led yo.docx
Now that you have completed a series of assignments that have led yo.docxNow that you have completed a series of assignments that have led yo.docx
Now that you have completed a series of assignments that have led yo.docxpicklesvalery
 
Now that you have completed your paper (ATTACHED), build and deliver.docx
Now that you have completed your paper (ATTACHED), build and deliver.docxNow that you have completed your paper (ATTACHED), build and deliver.docx
Now that you have completed your paper (ATTACHED), build and deliver.docxpicklesvalery
 
Now that you have identified the revenue-related internal contro.docx
Now that you have identified the revenue-related internal contro.docxNow that you have identified the revenue-related internal contro.docx
Now that you have identified the revenue-related internal contro.docxpicklesvalery
 
Now that you have read about Neandertals and modern Homo sapiens.docx
Now that you have read about Neandertals and modern Homo sapiens.docxNow that you have read about Neandertals and modern Homo sapiens.docx
Now that you have read about Neandertals and modern Homo sapiens.docxpicklesvalery
 
Now that you have had an opportunity to explore ethics formally, cre.docx
Now that you have had an opportunity to explore ethics formally, cre.docxNow that you have had an opportunity to explore ethics formally, cre.docx
Now that you have had an opportunity to explore ethics formally, cre.docxpicklesvalery
 
Novel Literary Exploration EssayWrite a Literary Exploration Ess.docx
Novel Literary Exploration EssayWrite a Literary Exploration Ess.docxNovel Literary Exploration EssayWrite a Literary Exploration Ess.docx
Novel Literary Exploration EssayWrite a Literary Exploration Ess.docxpicklesvalery
 
Notifications My CommunityHomeBBA 3551-16P-5A19-S3, Inform.docx
Notifications My CommunityHomeBBA 3551-16P-5A19-S3, Inform.docxNotifications My CommunityHomeBBA 3551-16P-5A19-S3, Inform.docx
Notifications My CommunityHomeBBA 3551-16P-5A19-S3, Inform.docxpicklesvalery
 
November-December 2013 • Vol. 22No. 6 359Beverly Waller D.docx
November-December 2013 • Vol. 22No. 6 359Beverly Waller D.docxNovember-December 2013 • Vol. 22No. 6 359Beverly Waller D.docx
November-December 2013 • Vol. 22No. 6 359Beverly Waller D.docxpicklesvalery
 
NOTEPlease pay attention to the assignment instructionsZero.docx
NOTEPlease pay attention to the assignment instructionsZero.docxNOTEPlease pay attention to the assignment instructionsZero.docx
NOTEPlease pay attention to the assignment instructionsZero.docxpicklesvalery
 
NOTE Use below Textbooks only. 400 WordsTopic Which doctrine.docx
NOTE Use below Textbooks only. 400 WordsTopic Which doctrine.docxNOTE Use below Textbooks only. 400 WordsTopic Which doctrine.docx
NOTE Use below Textbooks only. 400 WordsTopic Which doctrine.docxpicklesvalery
 
NOTE Everything in BOLD are things that I need to turn in for m.docx
NOTE Everything in BOLD are things that I need to turn in for m.docxNOTE Everything in BOLD are things that I need to turn in for m.docx
NOTE Everything in BOLD are things that I need to turn in for m.docxpicklesvalery
 
Note Be sure to focus only on the causes of the problem in this.docx
Note Be sure to focus only on the causes of the problem in this.docxNote Be sure to focus only on the causes of the problem in this.docx
Note Be sure to focus only on the causes of the problem in this.docxpicklesvalery
 
Note I’ll provide my sources in the morning, and lmk if you hav.docx
Note I’ll provide my sources in the morning, and lmk if you hav.docxNote I’ll provide my sources in the morning, and lmk if you hav.docx
Note I’ll provide my sources in the morning, and lmk if you hav.docxpicklesvalery
 
Note Here, the company I mentioned was Qualcomm 1. Email is the.docx
Note Here, the company I mentioned was Qualcomm 1. Email is the.docxNote Here, the company I mentioned was Qualcomm 1. Email is the.docx
Note Here, the company I mentioned was Qualcomm 1. Email is the.docxpicklesvalery
 
Note Please follow instructions to the T.Topic of 3 page pape.docx
Note Please follow instructions to the T.Topic of 3 page pape.docxNote Please follow instructions to the T.Topic of 3 page pape.docx
Note Please follow instructions to the T.Topic of 3 page pape.docxpicklesvalery
 
Note A full-sentence outline differs from bullet points because e.docx
Note A full-sentence outline differs from bullet points because e.docxNote A full-sentence outline differs from bullet points because e.docx
Note A full-sentence outline differs from bullet points because e.docxpicklesvalery
 
Notable photographers 1980 to presentAlmas, ErikAraki, No.docx
Notable photographers 1980 to presentAlmas, ErikAraki, No.docxNotable photographers 1980 to presentAlmas, ErikAraki, No.docx
Notable photographers 1980 to presentAlmas, ErikAraki, No.docxpicklesvalery
 
Note 2 political actions that are in line with Socialism and explain.docx
Note 2 political actions that are in line with Socialism and explain.docxNote 2 political actions that are in line with Socialism and explain.docx
Note 2 political actions that are in line with Socialism and explain.docxpicklesvalery
 

More from picklesvalery (20)

NPV, IRR, Payback period,— PA1Correlates with CLA2 (NPV portion.docx
NPV, IRR, Payback period,— PA1Correlates with CLA2 (NPV portion.docxNPV, IRR, Payback period,— PA1Correlates with CLA2 (NPV portion.docx
NPV, IRR, Payback period,— PA1Correlates with CLA2 (NPV portion.docx
 
Now that you have had the opportunity to review various Cyber At.docx
Now that you have had the opportunity to review various Cyber At.docxNow that you have had the opportunity to review various Cyber At.docx
Now that you have had the opportunity to review various Cyber At.docx
 
Now that you have completed a series of assignments that have led yo.docx
Now that you have completed a series of assignments that have led yo.docxNow that you have completed a series of assignments that have led yo.docx
Now that you have completed a series of assignments that have led yo.docx
 
Now that you have completed your paper (ATTACHED), build and deliver.docx
Now that you have completed your paper (ATTACHED), build and deliver.docxNow that you have completed your paper (ATTACHED), build and deliver.docx
Now that you have completed your paper (ATTACHED), build and deliver.docx
 
Now that you have identified the revenue-related internal contro.docx
Now that you have identified the revenue-related internal contro.docxNow that you have identified the revenue-related internal contro.docx
Now that you have identified the revenue-related internal contro.docx
 
Now that you have read about Neandertals and modern Homo sapiens.docx
Now that you have read about Neandertals and modern Homo sapiens.docxNow that you have read about Neandertals and modern Homo sapiens.docx
Now that you have read about Neandertals and modern Homo sapiens.docx
 
Now that you have had an opportunity to explore ethics formally, cre.docx
Now that you have had an opportunity to explore ethics formally, cre.docxNow that you have had an opportunity to explore ethics formally, cre.docx
Now that you have had an opportunity to explore ethics formally, cre.docx
 
Novel Literary Exploration EssayWrite a Literary Exploration Ess.docx
Novel Literary Exploration EssayWrite a Literary Exploration Ess.docxNovel Literary Exploration EssayWrite a Literary Exploration Ess.docx
Novel Literary Exploration EssayWrite a Literary Exploration Ess.docx
 
Notifications My CommunityHomeBBA 3551-16P-5A19-S3, Inform.docx
Notifications My CommunityHomeBBA 3551-16P-5A19-S3, Inform.docxNotifications My CommunityHomeBBA 3551-16P-5A19-S3, Inform.docx
Notifications My CommunityHomeBBA 3551-16P-5A19-S3, Inform.docx
 
November-December 2013 • Vol. 22No. 6 359Beverly Waller D.docx
November-December 2013 • Vol. 22No. 6 359Beverly Waller D.docxNovember-December 2013 • Vol. 22No. 6 359Beverly Waller D.docx
November-December 2013 • Vol. 22No. 6 359Beverly Waller D.docx
 
NOTEPlease pay attention to the assignment instructionsZero.docx
NOTEPlease pay attention to the assignment instructionsZero.docxNOTEPlease pay attention to the assignment instructionsZero.docx
NOTEPlease pay attention to the assignment instructionsZero.docx
 
NOTE Use below Textbooks only. 400 WordsTopic Which doctrine.docx
NOTE Use below Textbooks only. 400 WordsTopic Which doctrine.docxNOTE Use below Textbooks only. 400 WordsTopic Which doctrine.docx
NOTE Use below Textbooks only. 400 WordsTopic Which doctrine.docx
 
NOTE Everything in BOLD are things that I need to turn in for m.docx
NOTE Everything in BOLD are things that I need to turn in for m.docxNOTE Everything in BOLD are things that I need to turn in for m.docx
NOTE Everything in BOLD are things that I need to turn in for m.docx
 
Note Be sure to focus only on the causes of the problem in this.docx
Note Be sure to focus only on the causes of the problem in this.docxNote Be sure to focus only on the causes of the problem in this.docx
Note Be sure to focus only on the causes of the problem in this.docx
 
Note I’ll provide my sources in the morning, and lmk if you hav.docx
Note I’ll provide my sources in the morning, and lmk if you hav.docxNote I’ll provide my sources in the morning, and lmk if you hav.docx
Note I’ll provide my sources in the morning, and lmk if you hav.docx
 
Note Here, the company I mentioned was Qualcomm 1. Email is the.docx
Note Here, the company I mentioned was Qualcomm 1. Email is the.docxNote Here, the company I mentioned was Qualcomm 1. Email is the.docx
Note Here, the company I mentioned was Qualcomm 1. Email is the.docx
 
Note Please follow instructions to the T.Topic of 3 page pape.docx
Note Please follow instructions to the T.Topic of 3 page pape.docxNote Please follow instructions to the T.Topic of 3 page pape.docx
Note Please follow instructions to the T.Topic of 3 page pape.docx
 
Note A full-sentence outline differs from bullet points because e.docx
Note A full-sentence outline differs from bullet points because e.docxNote A full-sentence outline differs from bullet points because e.docx
Note A full-sentence outline differs from bullet points because e.docx
 
Notable photographers 1980 to presentAlmas, ErikAraki, No.docx
Notable photographers 1980 to presentAlmas, ErikAraki, No.docxNotable photographers 1980 to presentAlmas, ErikAraki, No.docx
Notable photographers 1980 to presentAlmas, ErikAraki, No.docx
 
Note 2 political actions that are in line with Socialism and explain.docx
Note 2 political actions that are in line with Socialism and explain.docxNote 2 political actions that are in line with Socialism and explain.docx
Note 2 political actions that are in line with Socialism and explain.docx
 

Recently uploaded

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 

Recently uploaded (20)

Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 

Suppose that a PRODUCT table contains two attributes, PROD_CODE an.docx

  • 1. Suppose that a PRODUCT table contains two attributes, PROD_CODE and VEND_CODE. Those two attributes have values of ABC, 125, DEF, 124, GHI, 124, and JKL, 123, respectively. The VENDOR table contains a single attribute, VEND_CODE, with values 123, 124, 125, and 126, respectively. (The VEND_CODE attribute in the PRODUCT table is a foreign key to the VEND_CODE in the VENDOR table.) Given that information, what would be the query output for a INTERSECT query based on these two tables? a. The query output will be: 125,124,123,126 b. The query output will be: 123 c. The query output will be: 125,124,124,123,123,124,125,126 d. The query output will be: 123,124,125 What is the difference between UNION and UNION ALL? a. A UNION ALL operator will yield all rows of both relations, including duplicates b. UNION yields unique rows
  • 2. c. UNION eliminates duplicates rows d. All of these choices are correct. A(n) ______________ is a block of PL/SQL code that is automatically invoked by the DBMS upon the occurrence of a data manipulation event (INSERT, UPDATE or DELETE.) a. stored procedure b. trigger c. view d. function __________________ means that the relations yield attributes with identical names and compatible data types. a. duplicated b. Set comparable
  • 3. c. Union compatible d. compatible-oriented Which of the following a parts of the definition of a trigger? a. The triggering level b. The triggering action c. The triggering timing d. All of these choices are correct. Which of the following relational set operators does NOT require that the relations are union-compatible? a. INTERSECT b. PROJECT
  • 4. c. MINUS d. UNION Suppose that you have two tables, EMPLOYEE and EMPLOYEE_1. The EMPLOYEE table contains the records for three employees: Alice Cordoza, John Cretchakov, and Anne McDonald. The EMPLOYEE_1 table contains the records for employees John Cretchakov and Mary Chen. Given that information, what is the query output for the INTERSECT query? a. The query output will be: John Cretchakov and Mary Chen b. The query output will be: Alice Cordoza, John Cretchakov, Anne McDonald and Mary Chen c. The query output will be: John Cretchakov d. The query output will be: Alice Cordoza, John Cretchakov, Anne McDonald, John Cretchakov and Mary Chen A _____________________ is a join that performs a relational product (or Cartesian product) of two tables. a. CROSS JOIN
  • 5. b. DUPLICATE JOIN c. OUTER JOIN d. INNER JOIN What Oracle function should you use to calculate the number of days between the current date and January 25, 1999? a. SELECT SYSDATE()-#25-JAN-1999#; b. SELECT SYSDATE – TO_DATE('25-JAN-1999', 'DD-MON- YYYY') FROM DUAL; c. SELECT SYSDATE FROM DUAL; d. SELECT SYSDATE()-JAN-#25-1999#; Using tables named T1 and T2, write a query example for a LEFT OUTER JOIN, assuming that T1 and T2 share a common column named C1. a. SELECT * FROM T1 OUTER JOIN T2 ON T1.C1 = T2.C2;
  • 6. b. SELECT * FROM T1 JOIN T2 ON T2.C1 = T2.C1; c. SELECT * FROM T1 LEFT JOIN T2 ON T1.C1 = T2.C1; d. SELECT * FROM T1 LEFT OUTER JOIN T2 ON T1.C1 = T2.C1; Suppose that you have two tables, EMPLOYEE and EMPLOYEE_1. The EMPLOYEE table contains the records for three employees: Alice Cordoza, John Cretchakov, and Anne McDonald. The EMPLOYEE_1 table contains the records for employees John Cretchakov and Mary Chen. Given that information, what is the query output for the MINUS query (specifically, SELECT * FROM EMPLOYEE MINUS SELECT * FROM EMPLOYEE_1)? a. The query output will be: Alice Cordoza, John Cretchakov, Anne McDonald and Mary Chen b. The query output will be: Alice Cordoza, John Cretchakov, Anne McDonald, John Cretchakov and Mary Chen c. The query output will be: Mary Chen
  • 7. d. The query output will be: Alice Cordoza and Anne McDonald What Oracle function should you use to return the current date? a. TODAY b. SYSDATE c. NOW Suppose that a PRODUCT table contains two attributes, PROD_CODE and VEND_CODE. Those two attributes have values of ABC, 125, DEF, 124, GHI, 124, and JKL, 123, respectively. The VENDOR table contains a single attribute, VEND_CODE, with values 123, 124, 125, and 126, respectively. (The VEND_CODE attribute in the PRODUCT table is a foreign key to the VEND_CODE in the VENDOR table.) Given that information, what would be the query output for a UNION ALL query based on these two tables? a. The query output will be: 125,124,124,123,123,124,125,126 b. The query output will be: 125,124,124,123
  • 8. c. The query output will be: 125,124,123,126 d. The query output will be: 123 _________________is a term used to refer to SQL statements that are contained within an application programming language such as COBOL, C++, ASP, Java, or ColdFusion. a. NoSQL b. Embedded SQL c. Dynamic SQL The order of the operands (tables) matter in a _______ query. a. PROJECT b. MINUS c. UNION
  • 9. d. INTERSECT Which of the following is true of Oracle sequences? a. You can have as many sequences as you want and they are not tied to any particular table. b. A sequence is a completely independent object. c. The sequence-generated value is not tied to any field in any table and can, therefore, be used on any attribute in any table. Which of the following is true of Oracle sequences? a. You can have as many sequences as you want and they are not tied to any particular table. b. A sequence is a completely independent object. c. The sequence-generated value is not tied to any field in any table and can, therefore, be used on any attribute in any table. d. All of these choices are correct.
  • 10. A(n) ______________ is a named collection of procedural and SQL statements that are stored in the database and that can be used to encapsulate and represent business transactions. a. trigger b. stored procedure c. view Suppose that you have two tables, EMPLOYEE and EMPLOYEE_1. The EMPLOYEE table contains the records for three employees: Alice Cordoza, John Cretchakov, and Anne McDonald. The EMPLOYEE_1 table contains the records for employees John Cretchakov and Mary Chen. Given that information, what is the query output for the UNION query? a. The query output will be: Alice Cordoza, John Cretchakov, Anne McDonald and Mary Chen b. The query output will be: John Cretchakov and Mary Chen c. The query output will be: Alice Cordoza, John Cretchakov, Anne McDonald, John Cretchakov and Mary Chen
  • 11. d. The query output will be: John Cretchakov A subquery can appear in which of the following places in a SQL statement? a. as part of a FROM clause, b. to the right of a HAVING clause conditional operator, c. in a EXISTS operator, d. All of these choices are correct. A __________ is a query (expressed as a SELECT statement) that is located inside another query and is normally executed first. a. multi-query b. subquery c. outside query
  • 12. d. special query What string function (in Oracle) should you use to list the first three characters of a company's EMP_LNAME values using a table named EMPLOYEE? a. SELECT STR(EMP_LNAME, 1, 3) FROM EMPLOYEE; b. SELECT STRING(EMP_LNAME, 1, 3) FROM EMPLOYEE; c. SELECT SUBSTRING(EMP_LNAME, 1, 3) FROM EMPLOYEE; d. SELECT SUBSTR(EMP_LNAME, 1, 3) FROM EMPLOYEE; _____________ is a term used to describe an environment in which the SQL statement is not known in advance; instead, the SQL statement is generated at run time. a. PL/SQL b. Embedded SQL c. Dynamic SQL
  • 13. d. NoSQL Suppose that a PRODUCT table contains two attributes, PROD_CODE and VEND_CODE. Those two attributes have values of ABC, 125, DEF, 124, GHI, 124, and JKL, 123, respectively. The VENDOR table contains a single attribute, VEND_CODE, with values 123, 124, 125, and 126, respectively. (The VEND_CODE attribute in the PRODUCT table is a foreign key to the VEND_CODE in the VENDOR table.) Given that information, what would be the query output for a MINUS query (VENDOR MINUS PRODUCT) based on these two tables? a. The query output will be: 124 b. The query output will be: 125,124,123,126 c. The query output will be: NULL d. The query output will be: 126 In the relational model, SQL operators are ________________ because they operate over entire sets of rows and columns (or tables) at once. a. set-oriented
  • 14. b. table-oriented c. completeness-oriented Which of the followings explains the difference between a regular subquery and a correlated subquery? a. A correlated subquery will execute once for each row evaluated by the outer query b. A regular subquery executes only once and the result is held for use by the outer query c. A regular subquery executes before the outer query d. All of these choices are correct. If you do not specify a join condition when joining tables, the result will be a ______________ or PRODUCT operation. a. CROSS JOIN
  • 15. b. DUPLICATE JOIN c. INNER JOIN d. OUTER JOIN A ______________ is a subquery that executes once for each row in the outer query; it will run the outer query first, and then it will run the inner subquery once for each row returned in the outer subquery. a. outside subquery b. uncorrelated subquery c. correlated subquery A relational view has which of the following characteristics? a. views are dynamically updated b. views may be used as the basis for reports or queries, just like tables
  • 16. c. views provide a level of security in the database A(n) ______________ is a special type of object that generates unique numeric values in ascending or descending order; it can be used to assign values to a primary key field in a table and it provides functionality similar to the Autonumber data type in MS Access. a. sequence b. key c. instance d. view which of the following is NOT considered an advantage of a stored procedure? a. Increase performance b. Help reduce code duplication through code isolation and code
  • 17. sharing c. Reduce network traffic d. None of these choices are correct. What are the types of results a subquery can return? a. a list of values only b. a single value, a list of values, or a virtual table c. a single value only d. a virtual table only The SQL standard prescribes three different types of __________ operations: LEFT, RIGHT, and FULL. a. OUTER join b. INNER join
  • 18. c. DUPLICATE join A(n) __________________ is a type of JOIN operation that yields all rows with matching values in the join columns as well as all unmatched rows ( those without matching values in the join columns). a. INNER JOIN b. OUTER JOIN c. CROSS JOIN d. DUPLICATE JOIN Suppose that a PRODUCT table contains two attributes, PROD_CODE and VEND_CODE. Those two attributes have values of ABC, 125, DEF, 124, GHI, 124, and JKL, 123, respectively. The VENDOR table contains a single attribute, VEND_CODE, with values 123, 124, 125, and 126, respectively. (The VEND_CODE attribute in the PRODUCT table is a foreign key to the VEND_CODE in the VENDOR table.) Given that information, what would be the query output for a UNION query based on these two tables? a. The query output will be: 123,124,125,126
  • 19. b. The query output will be: 125,124,124,123 c. The query output will be: 125,124,123,126 d. The query output will be: 123 Triggers are critical to proper database operation and management in which of the following ways? a. add functionality by automating critical actions and providing appropriate warnings for remedial action. b. used to enforce constraints that cannot be enforced at the DBMS design and implementation levels. c. can be used to enforce referential integrity, to update table values, insert records in tables, and call other stored procedures. d. All of these choices are correct. A(n) ________ is a virtual table based on a SELECT query.
  • 20. a. view b. copy c. schema Suppose that you have two tables, EMPLOYEE and EMPLOYEE_1. The EMPLOYEE table contains the records for three employees: Alice Cordoza, John Cretchakov, and Anne McDonald. The EMPLOYEE_1 table contains the records for employees John Cretchakov and Mary Chen. Given that information, what is the query output for the UNION ALL query? a. The query output will be: Alice Cordoza, John Cretchakov, Anne McDonald and Mary Chen b. The query output will be: John Cretchakov and Mary Chen c. The query output will be: John Cretchakov d. The query output will be: Alice Cordoza, John Cretchakov, Anne McDonald, John Cretchakov and Mary Chen
  • 21. The ______________________ will yield all rows with matching values in the join columns, plus all of the unmatched rows from the right table. a. CENTER OUTER JOIN b. RIGHT OUTER JOIN c. LEFT OUTER JOIN d. FULL OUTER JOIN Use the following scenario for questions from this chapter: You have been given a database for a small charity used to track donations made to it. It has the following structure: and the following sample data in the tables: Donor Donor_Id Donor_ FirstName Donor_ LastName Donor_Address Donor_City Donor_State Donor_ZipCode
  • 22. Donor_Phone Donor_Email 101 James James 123 Mockingbird Place Peoria IL 55556 555-555-2342 [email protected] 175 Joseph Mays 54321 7th St Atlantic City NJ 15678 555-555-9877 [email protected] 207 Susan Ames 777 Main St Burlington KY 41098 555-555-3478 [email protected] 303 Nancy Zornes P.O. Box 88776 Peoria IL 55578-8776
  • 23. 555-555-1255 [email protected] ReceiptType ReceiptType_Id ReceiptType_Description C Cash CK Check/Money Order CC Credit Card PD Payroll Deduction A Art / Collectible I In-kind Fund Fund_Id Fund_Name G General Operation S Scholarship B Building Maintenance C Capital Campaign Receipt Receipt_Id Donor_Id Receipt_Date ReceiptType_Id
  • 24. Fund_Id Receipt_Amount Receipt_Description 1001 101 2015-01-05 CK G 100 1002 207 2015-01-05 C S 250 For: Virginia Wolfe Wilde 1003 207 2015-01-05 C B 100 1004 175 2015-01-06 CC G 137.5 In Memory of Bob 1005 101 2015-02-14 CK G
  • 25. 100 1006 175 2015-02-20 A C 15000000 Picasso Painting For reporting purposes the client would like you to create a temporary table called “FundSummary” that contains the fund id, donor id, the number of receipts (donations) made to the fund by a donor, and the total of the receipts and the donor. The new table from the sample data would look like: B 207 1 100 C 175 1 15000000 G 101 2 200 G 175 1 137.5 S
  • 26. 207 1 250 Fill in the blanks of the SQL Statements: Fund_Id VARCHAR(10) , Donor_id VARCHAR(10) , Count_Of_Receipts INTEGER, Total_Receipts DECIMAL(10,2), (Fund_Id, Donor_Id), FOREIGN KEY (Donor_Id) REFERENCES ( ), FOREIGN KEY ( ) REFERENCES (Fund_Id) ); INSERT INTO FundSummary Fund_Id, Donor_Id, (Receipt_Id), ( ) FROM Receipt Fund_Id, ; Fill in the blanks with words that would best complete the passage. donor_id FundSummary receipt_amount ( not null select sum donor_id primary by group CREATE key donor
  • 27. not fund_id fund count null TABLE Use the following scenario for questions from this chapter: You have been given a database for a small charity used to track donations made to it. It has the following structure: and the following sample data in the tables: Donor Donor_Id Donor_ FirstName Donor_ LastName Donor_Address Donor_City Donor_State Donor_ZipCode Donor_Phone Donor_Email 101 James James 123 Mockingbird Place Peoria IL 55556 555-555-2342 [email protected] 175 Joseph
  • 28. Mays 54321 7th St Atlantic City NJ 15678 555-555-9877 [email protected] 207 Susan Ames 777 Main St Burlington KY 41098 555-555-3478 [email protected] 303 Nancy Zornes P.O. Box 88776 Peoria IL 55578-8776 555-555-1255 [email protected] ReceiptType ReceiptType_Id ReceiptType_Description C Cash CK Check/Money Order CC Credit Card PD
  • 29. Payroll Deduction A Art / Collectible I In-kind Fund Fund_Id Fund_Name G General Operation S Scholarship B Building Maintenance C Capital Campaign Receipt_Id Donor_Id Receipt_Date ReceiptType_Id Fund_Id Receipt_Amount Receipt_Description 1001 101 2015-01-05 CK G 100 1002 207 2015-01-05 C
  • 30. S 250 For: Virginia Wolfe Wilde 1003 207 2015-01-05 C B 100 1004 175 2015-01-06 CC G 137.5 In Memory of Bob 1005 101 2015-02-14 CK G 100 1006 175 2015-02-20 A C 15000000 Picasso Painting Receipt The client wants a listing of donor id, last name, first name, receipt date, type, and amount for all receipts greater than $100.00. The client wants the result sorted by donor last name,
  • 31. first name, and the donation date. The query result from the sample data would look like: 207 Ames Susan 2015-01-05 C 250 175 Mays Joseph 2015-01-06 CC 137.5 175 Mays Joseph 2015-02-20 A 15000000 Fill in the blanks of the SQL Statement: Donor. , Donor_LastName, Donor_FirstName, Receipt_Date, Receipt.ReceiptType_Id, Receipt_Amount Receipt Receipt.Donor_Id = Receipt_Amount 100.00 Donor_LastName, Donor_FirstName, Receipt_Date; Fill in the blanks with words that would best complete the passage. from > donor.donor_id
  • 32. select donor where and order by donor_id , The problems for this chapter use a database for a simple department store that sells items to customers and wants to keep track of the invoices, the selling price (if an item is on sale), and the sales tax (7%) to be collected on some items. Every customer and invoice are assigned unique numbers. All items have a Universal Product Code (UPC) number and bar-code assigned to each unique item. Food and non-carbonated beverages are not taxed, but clothing, home goods, and most other items are. The structure of the tables are described in the following crows foot ERD: Sample Data for the tables follow: Customer Customer_Id Customer_ FirstName Customer_ LastName Customer_ Address Customer_ City Customer_ State Customer_
  • 33. ZipCode Customer_ Phone Customer_Email 342 Linda Spangler 2323 Roanoke Pk Floyd VA 24987 555-555-5646 [email protected] 505 Rodney Ray 12399 27th Ave New York NY 10097 555-555-0909 [email protected] 776 Nancy Reno P.O.Box 98 Carter City KY 41155 555-555-2342 [email protected] 987 Gustov Jones 333 East Main St Jamestown
  • 34. VA 23099 555-555-9876 [email protected] ItemType ItemType_Id ItemType_Description W Woman's Clothing M Men's Clothing WA Woman's Accessories MA Men's Accessories A General Accessories O Other ItemSize ItemSize_Id ItemSize_Description XS Extra Small S Small M Medium L Large XL Extra Large Item
  • 36. 012345234475 Blue Blouse W M 29.95 1 012345234491 Blue Blouse W XL 29.95 1 012345224889 12 Inch Pearl Necklace WA 345.95 1 012345224126 10 Inch Pearl Necklace WA 298.95 1 012345334678 Explorer Cargo Shorts M S 33.45 1 012345334734 Explorer Cargo Shorts M M 33.45 1
  • 37. 012345334795 Explorer Cargo Shorts M L 33.45 1 012345334889 Explorer Cargo Shorts M XL 33.45 1 012345335101 Pink Silk Tie MA 67.55 1 012345335303 Pink and Green Silk Tie MA 67.55 1 012345999001 Yummy Bottled Water O 1.29 0 Invoice Invoice_Number Customer_Id Invoice_Date Invoice_Taxable
  • 40. 29.95 10111 012345224126 1 298.95 202.99 Suppose that we have a second table with vendor information (sample is below) in it and that we want to create a single telephone directory with both vendor and customer information in it. Vendor_Id Vendor_CompanyName Vendor_Address Vendor_City Vendor_State Vendor_ZipCode Vendor_Phone Vendor_Email 101 QRS Importers 12345 Dock St San Fransisco CA 97654 555-544-4444 [email protected] 505 ABC Supply 505 Euclid Ave Lexington KY 40505 555-505-0505 [email protected] The phone directory should contain the state, a name column
  • 41. with either the customer last name and first name concatenated with a comma or the vendor company name, city, and phone number. Output should be sorted by state then by name. Your results should look like: State Name City Phone CA QRS Importers San Fransisco 555-544-4444 KY ABC Supply Lexington 555-505-0505 KY Reno, Nancy Carter City 555-555-2342 NY Ray, Rodney New York 555-555-0909 VA Jones, Gustov Jamestown 555-555-9876 VA Spangler, Linda Floyd 555-555-5646 Fill in the blanks (remember a blank, drop "blank" as answer) SELECT , , , FROM ( SELECT || ', ' || Customer_FirstName AS Name, Customer_City , Customer_State AS State,
  • 42. Customer_Phone AS Phone FROM Customer SELECT Vendor_CompanyName AS Name, Vendor_City AS City, Vendor_State AS State, Vendor_Phone AS Phone FROM Vendor ) State, Name; Fill in the blanks with words that would best complete the passage. blank Phone city City Customer_LastName blank Name AS BY UNION State ORDER The problems for this chapter use a database for a simple
  • 43. department store that sells items to customers and wants to keep track of the invoices, the selling price (if an item is on sale), and the sales tax (7%) to be collected on some items. Every customer and invoice are assigned unique numbers. All items have a Universal Product Code (UPC) number and bar-code assigned to each unique item. Food and non-carbonated beverages are not taxed, but clothing, home goods, and most other items are. The structure of the tables are described in the following crows foot ERD: Sample Data for the tables follow: Customer Customer_Id Customer_ FirstName Customer_ LastName Customer_ Address Customer_ City Customer_ State Customer_ ZipCode Customer_ Phone Customer_Email 342 Linda Spangler 2323 Roanoke Pk Floyd VA
  • 44. 24987 555-555-5646 [email protected] 505 Rodney Ray 12399 27th Ave New York NY 10097 555-555-0909 [email protected] 776 Nancy Reno P.O.Box 98 Carter City KY 41155 555-555-2342 [email protected] 987 Gustov Jones 333 East Main St Jamestown VA 23099 555-555-9876 [email protected] ItemType ItemType_Id ItemType_Description W Woman's Clothing
  • 45. M Men's Clothing WA Woman's Accessories MA Men's Accessories A General Accessories O Other ItemSize ItemSize_Id ItemSize_Description XS Extra Small S Small M Medium L Large XL Extra Large Item UPC Item_Description ItemType_Id ItemSize_Id Item_Price Item_Taxable 012345234569 Cream Blouse W S
  • 46. 29.95 1 012345234576 Cream Blouse W M 29.95 1 012345234588 Cream Blouse W L 29.95 1 012345234590 Cream Blouse W XL 29.95 1 012345234468 Blue Blouse W S 29.95 1 012345234475 Blue Blouse W M 29.95 1 012345234491 Blue Blouse W XL
  • 47. 29.95 1 012345224889 12 Inch Pearl Necklace WA 345.95 1 012345224126 10 Inch Pearl Necklace WA 298.95 1 012345334678 Explorer Cargo Shorts M S 33.45 1 012345334734 Explorer Cargo Shorts M M 33.45 1 012345334795 Explorer Cargo Shorts M L 33.45 1 012345334889 Explorer Cargo Shorts M XL
  • 48. 33.45 1 012345335101 Pink Silk Tie MA 67.55 1 012345335303 Pink and Green Silk Tie MA 67.55 1 012345999001 Yummy Bottled Water O 1.29 0 Invoice Invoice_Number Customer_Id Invoice_Date Invoice_Taxable Invoice_NonTaxable Invoice_SalesTax Invoice_Total 10101 987 2015-07-27 29.95 2.58 2.1 34.63
  • 50. 1.29 1.29 10102 012345334889 1 33.45 33.45 10107 012345335303 1 67.55 59.99 10107 012345999001 1 1.29 1.29 10111 012345234576 1 29.95 29.95 10111 012345234475 1 29.95 29.95 10111 012345224126 1 298.95 202.99 You have been tasked to generate a report from the database using a single SQL statement to do the following: List all items with the number of invoices that the items have been on and the total of the sales of that item. Display in order
  • 51. by type, description, and size. Your generated output should look like: UPC Item_Description ItemType_Id ItemSize_Id Invoice_Count Total_Sales 012345334795 Explorer Cargo Shorts M L 1 1 012345334734 Explorer Cargo Shorts M M 0 012345334678 Explorer Cargo Shorts M S 0 012345334889 Explorer Cargo Shorts M XL 1 1 012345335101 Pink Silk Tie MA
  • 52. 0 012345335303 Pink and Green Silk Tie MA 1 1 012345999001 Yummy Bottled Water O 2 3 012345234475 Blue Blouse W M 1 1 012345234468 Blue Blouse W S 0 012345234491 Blue Blouse W XL 0 012345234588 Cream Blouse W L
  • 53. 0 012345234576 Cream Blouse W M 1 1 012345234569 Cream Blouse W S 0 012345234590 Cream Blouse W XL 0 012345224126 10 Inch Pearl Necklace WA 1 1 012345224889 12 Inch Pearl Necklace WA 0 Fill in the blanks (remember a blank, drop "blank" as answer) SELECT Item.UPC, Item.Item_Description, Item.ItemType_Id, Item.ItemSize_Id, COUNT(Invoice.Invoice_Number) AS
  • 54. Invoice_Count, SUM(InvoiceDetail.Detail_Quantity) AS Total_Sales FROM item InvoiceDetail ON item. = .UPC Invoice ON .Invoice_Number = InvoiceDetail. GROUP BY Item.UPC ORDER BY Item.ItemType_id, Item.Item_Description, Item.ItemSize_Id; Fill in the blanks with words that would best complete the passage. InvoiceDetail LEFT JOIN blank UPC LEFT Invoice Invoice_Number JOIN Which of the following is the data dictionary's function in database design? a. It makes it easier to check for the existence of synonyms and homonyms, to check whether all attributes exist to support required reports, to verify appropriate relationship
  • 55. representations, and so on. b. Its contents are both developed and used during the six DBLC phases. c. It provides a precise description of the characteristics of all the entities and attributes found within the database. d. All of these choices are correct. In the decentralized conceptual database design approach, the aggregation process requires the lead designer to assemble a single model where which of the following aggregation problems must be addressed? a. synonyms b. entity subclasses c. conflicting object definitions d. All of these choices are correct. ______________ design begins by identifying the different
  • 56. entity types and the definition of each entity's attributes. a. Bottom up b. Over the top c. Top down d. None of these choices are correct. _______________ is the last stage in the database design process. a. Conceptual design b. Database design c. Physical design d. Logical design Which conceptual database design is best suited to relatively small and simple databases that lend themselves well to a bird's
  • 57. eye view of the entire database and may be designed by a single person or by a small and informally constituted design team? a. Centralized database design b. Distributed database design c. Decentralized database design d. Top-down database design A(n) ________________________ is a system that provides for data collection, storage, and retrieval; facilitates the transformation of data into information; and manages both data and information. It is composed of hardware, the DBMS and other software, database(s), people, and procedures. a. information system b. storage system c. software system d. database system
  • 58. ____________are narrative descriptions of the business policies, procedures, or principles that are derived from a detailed description of operations. a. Entity rules b. Database rules c. Attribute rules d. Business rules The DBLC is composed of _____ phases. a. four b. six c. three d. five Business rules are particularly valuable to database designers,
  • 59. because they help define which of the following? a. attributes b. relationships c. entities d. All of these choices are correct. The _________________ goal is to design an enterprise-wide database that is based on a specific data model but independent of physical-level details. a. conceptual design b. database design c. physical design d. logical design Which of the following is NOT a step performed in the physical
  • 60. design stage in the database design process? a. Validate the model integrity constraints b. Determine performance measurements c. Define integrity and security measures d. Define data storage organization Which of the following is established during the systems design phase, in which the designer completes the design of all required system processes? a. The database schema b. The detailed system specifications c. The user interface d. None of these choices are correct.
  • 61. Which of the following is established during the systems design phase, in which the designer completes the design of all required system processes? a. The database schema b. The detailed system specifications c. The user interface d. None of these choices are correct. The conceptual design is composed of _____ steps. a. seven b. five c. four d. three Ultimately, the purpose of an _____________________ is to
  • 62. facilitate good decision making by making relevant and timely information available to the decision makers. a. information system b. database system c. software system d. storage system Which conceptual database design is best when company operations are spread across multiple operational sites or when the database has multiple entities that are subject to complex relations? a. Distributed database design b. Top-down database design c. Centralized database design d. Decentralized database design
  • 63. SDLC is the acronym that is used to label the _______________________________. a. System Design Life Cycle b. System Development Life Cycle c. Software Design Life Cycle d. Software Development Life Cycle A(n) ______________________ backup of the database creates a backup of only those database objects that have changed since the last full backup. a. differential b. partial c. complete d. transaction
  • 64. Which of the following shows how systems analysis fits into a discussion about information systems? a. By evaluating the existing system b. By developing a logical systems design c. By establishing end-user requirements d. All of these choices are correct. DBLC is the acronym that is used to label the _______________________________. a. Database Life Cycle b. Development Logical Cycle c. Database Logical Cycle d. Development Life Cycle The SDLC is composed of _____ phases.
  • 65. a. four b. three c. seven d. five Which of the following is NOT a step performed in the logical design stage in the database design process? a. Validate the model using normalization b. Validate the model using user requirements c. Validate the model integrity constraints d. None of these choices are correct. A(n) _____________ is the use of different names to identify the same object, such as an entity, an attribute, or a relationship.
  • 66. a. synonym b. pseudonym c. homonym d. antonym Database design must yield a database that does which of the following? a. does not fall prey to uncontrolled data duplication, thus preventing data anomalies and the attendant lack of data integrity. b. is efficient in its provision of data access. c. serves the needs of the information system. d. All of these choices are correct. __________ design first defines the required attributes and then groups the attributes to form entities.
  • 67. a. Bottom up b. Top down c. Over the top d. None of these choices are correct. The ___________________ specifies that all the data defined in the data model are actually required to fit present and expected future data requirements. a. completeness data rule b. maximum data rule c. multiple data rule d. minimal data rule Which of the following is NOT one of the six (6) steps identified as part of the ER model verification process?
  • 68. a. Verify all processes against the system requirements b. Identify each module and its components c. Identify the ER model's central entity d. Map the entity names to proper process names How many steps are required in the development of the conceptual model using an ER diagram? a. six b. seven c. eight d. two Which of the following is NOT an important factor in the selection of a DBMS software product? a. DBMS features and tools
  • 69. b. Cost c. Portability d. Number of employees 2.Each of the following activities are commonly performed during the implementation of the Database Life Cycle (DBLC). Fill in the blank, before each activity, with the phase number of the DBLS that this activity would normally be performed. DBLC Task Numbers: 1. Database initial study 2. Database design 3. Implementation and loading 4. Testing and evaluation 5. Operation 6. Maintenance and evolution Load the initial values into the tables Finish user documentation Adding additional tables, attributes, and indexes Attempt to gain unauthorized access to the data Interview management Convert existing data Study the competition's database Plan how to grant different levels of access to different user groups Install the database
  • 70. Train users Changing constraints to match changes in business rules Define budget and scope Select a DBMS software solution Draw a logical ERD Performing software patches to the DBMS Create the database Understand how this database will connect to other databases in the organization Develop a Conceptual Model Make sure application software updates the database Regular security audits Define objectives Create a detailed model that can be physically implemented Top of Form Bottom of Form