Take Test: 2. Chapter 11 Quiz - Click Here Question 1 Contents of the BOOKS tabl
ID: 3580153 • Letter: T
Question
Take Test: 2. Chapter 11 Quiz - Click Here
Question 1
Contents of the BOOKS table
Based on the contents of the BOOKS table, which of the following SQL statements will return the total profit generated by books in the COOKING category?
SELECT TOTAL(retail-cost) FROM books
WHERE category = 'COOKING';
SELECT TOTAL(retail-cost) FROM books
GROUP BY category;
SELECT SUM(retail-cost) FROM books
WHERE category = 'COOKING';
SELECT SUM(retail-cost) FROM books
GROUP BY category = 'COOKING';
0.1 points
Question 2
Contents of the BOOKS table
Based on the contents of the BOOKS table, which of the following will display the date of the book with the earliest publication date?
SELECT MIN(pubdate)
FROM books;
SELECT title
FROM books
WHERE pubdate = MIN(pubdate);
SELECT title
FROM books
WHERE pubdate = MINIMUM(pubdate);
SELECT MINIMUM(pubdate)
FROM books;
0.1 points
Question 3
Contents of the BOOKS table
Based upon the contents of the BOOKS table, which of the following will determine the number of books in the computer category?
SELECT SUM(category)
FROM books
WHERE category = 'COMPUTER';
SELECT TOTAL(*)
FROM books
WHERE category = 'COMPUTER';
SELECT COUNT(category)
FROM books
WHERE category = 'COMPUTER';
none of the above
0.1 points
Question 4
Contents of the ORDERS table
Based on the contents of the ORDERS table, which of the following SQL statements will display the number of orders that have not been shipped?
SELECT order#, COUNT(shipdate)
FROM orders
WHERE shipdate IS NULL;
SELECT order#, COUNT(shipdate)
FROM orders
WHERE shipdate IS NULL
GROUP BY order#;
SELECT COUNT(shipdate)
FROM orders
WHERE shipdate IS NULL;
SELECT COUNT(*)
FROM orders
WHERE shipdate IS NULL;
0.1 points
Question 5
Contents of the ORDERS table
Based on the contents of the ORDERS table, which of the following SELECT statements will determine the number of orders placed by each customer?
SELECT COUNT(DISTINCT(customer#))
FROM orders;
SELECT COUNT(*)
FROM orders;
SELECT customer#, COUNT(customer#)
FROM orders
GROUP BY customer#;
none of the above
0.1 points
Question 6
Contents of the ORDERS table
Based upon the contents of the ORDERS table, which of the following will display how many orders were shipped to each state?
SELECT shipstate, COUNT(*)
FROM orders;
SELECT shipstate, COUNT(customer#)
FROM orders;
SELECT shipstate, COUNT(*)
FROM orders
HAVING COUNT(*) >0;
SELECT shipstate, COUNT(*)
FROM orders
GROUP BY shipstate;
0.1 points
Question 7
If the DISTINCT keyword is not included in the AVG function, the ____ keyword will be assumed.
ALL
UNIQUE
GROUP
none of the above
0.1 points
Question 8
The AVG function can be used with ____ values.
numeric
character
date
all of the above
0.1 points
Question 9
The MAX function can be used with which type of columns?
numeric
date
character
all of the above
0.1 points
Question 10
The MIN function can be only be used with ____ columns.
numeric
character
date
all of the above
0.1 points
Question 11
The SUM function can only be used with ____ data.
numeric
character
date
alphanumeric
0.1 points
Question 12
The ____ clause is used to indicate that groups should be created.
ORDER BY
GROUP BY
AGGREGATED
GROUPING
0.1 points
Question 13
The ____ function calculates the average of the numeric values in a specified column.
AVG
AVERAGE
MEAN
AG
0.1 points
Question 14
The ____ function calculates the standard deviation for a specific set of data.
STDDEVIATION
STD
STDDEV
STANDARDDEV
0.1 points
Question 15
The ____ function returns the smallest value in a specified column.
LOW
LOWEST
MIN
MINIMUM
SELECT TOTAL(retail-cost) FROM books
WHERE category = 'COOKING';
SELECT TOTAL(retail-cost) FROM books
GROUP BY category;
SELECT SUM(retail-cost) FROM books
WHERE category = 'COOKING';
SELECT SUM(retail-cost) FROM books
GROUP BY category = 'COOKING';
Explanation / Answer
Answers:
Q1 : SELECT SUM(retail-cost) FROM books WHERE category = 'COOKING'; //calculates the sum
Q2: SELECT MIN(pubdate) FROM books; //this will display the least date
Q3: none of the above // it must use COUNT(*)
Q4: SELECT COUNT(*) FROM orders WHERE shipdate IS NULL; // this will display only the number of orders not shipped.
Q5: none of the above // it must use COUNT(*)
Q6: SELECT shipstate, COUNT(*) FROM orders GROUP BY shipstate;
Q7: ALL
Q8: numeric
Q9: all of the above
Q10: all of the above
Q11: numeric
Q12: GROUP BY
Q13: AVG
Q14: STDDEV
Q15: MIN
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.