Chapter 11

  1. The VAR function is used to determine the variance contained within a set of data.

    True/False
    False
  2. The COUNT(*) function is only used to count the number of records containing NULL values.


    True

     

    False
    False
  3. The COUNT function can be used to count NULL, as well as, non-NULL values.


    True

     

    False
    True
  4. The STDDEV function calculates the standard deviation for the data contained in a specified field. _________________________


    True

     

    False
    t
  5. Pattern matching features available in a SELECT are targeted to analyze patterns or trends of a specific column of data across many rows.


    True

     

    False
    t
  6. When group functions are nested, the inner function is always resolved first. _________________________


    True

     

    False
    t
  7. The STDVAR function is used to determine the standard deviation of numeric data.

     

    True


    False
    F
  8. The ORDER BY clause is used to group data. _________________________


    True

     

    False
    F
  9. When a SELECT statement includes WHERE, HAVING, and GROUP BY clauses, the GROUP BY clause is always evaluated first. _________________________

     

    True


    False
    F
  10. The WHERE clause filters the data before grouping, while the HAVING clause filters the groups after grouping is performed. _________________________

     

    True


    False
    t
  11. The COUNT(*) function can be used to count the number of rows containing NULL and non-NULL values. _________________________

     

    True


    False
    t
  12. The GROUP BY clause can only be used when a SELECT statement includes a group function.

     

    True


    False
    f
  13. The GROUP BY clause is used to group data.


    True

     

    False
    t
  14. The MAX functions returns the smallest value stored in the specified column. _________________________

     

    True


    False
    f
  15. The COUNT function can only be used for numeric columns.

     

    True


    False
    f
  16. The COUNT function can only be used for numeric columns.

     

    True


    False
    f
  17. The COUNT function can only be used for numeric columns.

     

    True


    False
    f
  18. The MIN function is used to determine the smallest value in a specified column.


    True

     

    False
    t
  19. The VARIANCE function is used to determine the variance in a group of numeric data.


    True

     

    False
    t
  20. The DISTINCT keyword cannot be used with the MAX function.

     

    True


    False
    f
  21. The MIN function can be used with the DISTINCT or ALL keywords. _________________________

     

    True


    False
    t
  22. Group functions return one result per group of rows processed.

     

    True


    False
    t
  23. If
    both nonaggregated and aggregated columns are used in the SELECT
    clause, the GROUP BY clause must contain the nonaggregated columns.

     

    True


    False
    t
  24. The MAX function can only be used with numeric or date columns.

     

    True


    False
    f
  25. Columns used to group data in the GROUP BY clause must also be listed in the SELECT clause.


    True

     

    False
    f
  26. The ____ function can be used to determine the number of rows meeting a specific condition.




     
    A.
    ADD


     
    B.
    SUM



    C.
    COUNT


     
    D.
    TOTAL
    c
  27. The AVG function can be used with ____ values.





    A.
    numeric


     
    B.
    character


     
    C.
    date


     
    D.
    all of the above
    a
  28. The ____ function returns the smallest value in a specified column.




     
    A.
    LOW


     
    B.
    LOWEST



    C.
    MIN


     
    D.
    MINIMUM
    c
  29. Based upon the contents of the ORDERS table, which of the following will display how many orders were shipped to each state?

    A. SELECT shipstate,COUNT(*)
        FROM orders;

    B. SELECT shipstate,COUNT(customer#)
        FROM orders;

    C. SELECT shipstate,COUNT(*)
        FROM orders
        HAVING COUNT(*) >0

    D. SELECT shipstate,COUNT(*)
        FROM orders
        GROUP BY shipstate;
    • D. SELECT shipstate,COUNT(*)
    •     FROM orders
    •     GROUP BY shipstate;
  30. Functions that return one result per group of rows are called ____ functions.

    A. group

    B. multiple-row

    C. aggregate

    D. all of the above
    D. all of the above
  31. A group function can be nested inside a(n)____.

    A. group function

    B. single-row function

    C. order function

    D. both a and b
    D. both a and b
  32. The MIN function can be used with ____ columns.

    A. numeric

    B. character

    C. date

    D. all of the above
    D. all of the above

  33. Based upon the contents of the BOOKS tables, which of the following SQL statements will return the number of different publishers represented in the table?

    A. SELECT COUNT(DISTINCT pubid)
        FROM books;

    B. SELECT DISTINCT COUNT(pubid)
        FROM books;

    C. SELECT DISTINCT (COUNT(pubid))
        FROM books;

    D. SELECT (DISTINCT COUNT(pubid))
        FROM books;
    • A. SELECT COUNT(DISTINCT pubid)
    •     FROM books;

  34. Based on the contents of the BOOKS table, which of the following is a valid SQL statement?

    A. SELECT pubid, AVERAGE(retail-cost) "Average Profit"
        FROM books;

    B. SELECT pubid, AVERAGE(retail-cost) "Average Profit"
        FROM books
        GROUP BY pubid;

    C. SELECT pubid, AVG(retail-cost) "Average Profit"
        FROM books
        GROUP BY pubid;

    D. SELECT pubid, AVG(retail-cost) "Average Profit"
        FROM books
        HAVING retail-cost > 25;
    • C. SELECT pubid, AVG(retail-cost) "Average Profit"
    •     FROM books
    •     GROUP BY pubid;
  35. What clause offers many options to identify measures and patterns to analyze in a query?

    A. ANALYZE

    B. MATCH_RECOGNIZE

    C. PATTERN_MATCH

    D. MATCH_TREND
    B. MATCH_RECOGNIZE
  36. Which of the following is a valid statement?

    A. The ORDER BY clause cannot be used in a SELECT statement containing a GROUP BY clause.

    B. Data returned from a GROUP BY clause will automatically be sorted in descending order.

    C. Column aliases cannot be used in a GROUP BY clause.

    D. Columns referenced in the GROUP BY clause must also be contained in the SELECT clause.
    C. Column aliases cannot be used in a GROUP BY clause.
  37. The VARIANCE function can be used with ____ columns.




     
    A.
    alphanumeric



    B.
    numeric


     
    C.
    date


     
    D.
    none of the above
    B.numeric
  38. Which of the following can be used with date columns?

     




     
    A.
    MIN


     
    B.
    MAX


     
    C.
    COUNT



    D.
    all of the above
    D.all of the above
  39. If
    a group function is used in the SELECT clause, any ____ listed in the
    SELECT clause must also be listed in the GROUP BY clause.





    A.
    aggregate function


     
    B.
    single-row function


     
    C.
    individual column


     
    D.
    all of the above
    C.individual column
  40. Which of the following is a correct statement?





    A.
    An asterisk can be used as the argument for the COUNT function to include NULL values in the results.


     
    B.
    The NULL keyword can be included in the argument of the COUNT function to include NULL values in the results.


     
    C.
    The ALL keyword can be included in the argument of the COUNT function to include NULL values in the results.


     
    D.
    The INCLUDE NULLS keywords can be included in the argument for the COUNT function to include NULL values in the results.
    A.An asterisk can be used as the argument for the COUNT function to include NULL values in the results.
  41. If the DISTINCT keyword is not included in the STDDEV function, the ____ keyword will be assumed.





    A.
    UNIQUE


     
    B.
    ALL


     
    C.
    NONULLS


     
    D.
    none of the above
    B.ALL
  42. If the DISTINCT keyword is not included in the SUM function, the ____ keyword will be assumed.




     
    A.
    UNIQUE



    B.
    ALL


     
    C.
    RANDOM


     
    D.
    none of the above
    B.ALL
  43. Based
    on the contents of the BOOKS table, which of the following SQL
    statements will return the total profit generated by books provided by
    publisher 4?

     




     
    A.
    SELECT TOTAL(retail-cost) FROM books
    WHERE pubid = 4;


     
    B.
    SELECT TOTAL(retail-cost) FROM books
    GROUP BY pubid;



    C.
    SELECT SUM(retail-cost) FROM books
    WHERE pubid = 4;


     
    D.
    SELECT SUM(retail-cost) FROM books
    GROUP BY pubid = 4;
    C.SELECT SUM(retail-cost) FROM booksWHERE pubid = 4;
  44. If a SELECT statement contains HAVING, GROUP BY, and WHERE clauses, the ____ clause will be processed last.





    A.
    HAVING


     
    B.
    GROUP BY


     
    C.
    WHERE


     
    D.
    SELECT
    A.HAVING
  45. Which of the following cannot be used with date columns?




     
    A.
    MIN


     
    B.
    MAX



    C.
    AVG


     
    D.
    all of the above
    C.AVG
  46. 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?

     




     
    A.
    SELECT order#, COUNT(shipdate)
    FROM orders
    WHERE shipdate IS NULL;


     
    B.
    SELECT order#, COUNT(shipdate)
    FROM orders
    WHERE shipdate IS NULL
    GROUP BY order#;



    C.
    SELECT COUNT(shipdate)
    FROM orders
    WHERE shipdate IS NULL;


     
    D.
    SELECT COUNT(*)
    FROM orders
    WHERE shipdate IS NULL;
    D.SELECT COUNT(*)FROM ordersWHERE shipdate IS NULL;
  47. Which of the following lines of the SQL statement contains an error?
                           1 SELECT title, MAX(retail)
                           2 FROM books
                           3 WHERE retail > 30
                           4 AND pubid = 1
                           5 GROUP BY retail




     
    A.
    Line 2


     
    B.
    Line 3


     
    C.
    Line 4



    D.
    Line 5
    D.Line 5
  48. The ____ function is used to determine how widely data are spread out within a group.




     
    A.
    STDDEV


     
    B.
    STANDARDDEV



    C.
    VARIANCE


     
    D.
    VAR
    C.VARIANCE
  49. The ____ function can be used to include NULL values in a calculation.




     
    A.
    AVG


     
    B.
    SUM


     
    C.
    NULL



    D.
    NVL
    D.NVL
  50. Based on
    the contents of the ORDERS table, which of the following SELECT
    statements will determine the number of orders placed by each customer?

     




     
    A.
    SELECT COUNT(DISTINCT(customer#))
    FROM orders;


     
    B.
    SELECT COUNT(*)
    FROM orders;


     
    C.
    SELECT customer#, COUNT(customer#)
    FROM orders
    GROUP BY customer#;



    D.
    none of the above
    C.SELECT customer#, COUNT(customer#)FROM ordersGROUP BY customer#;
Author
Lencha
ID
325804
Card Set
Chapter 11
Description
Chapter 11
Updated