1. 1. Which SQL clause comes immediately after SELECT?: C. WHERE
2. 2. If a query against database CC3 includes the clause, WHERE description
= 'Express Care', which of the following is true?
a. description must be included in the SELECT
b. cc3.types must be included in the FROM
c. GROUP BY description must also be included
d. None of these
*Note that cc3.types could have been included in the JOIN instead of FROM: d. None of these
*Note that cc3.types could have been included in the JOIN instead of FROM
3. 3. Which table allows you to reference ethnicities by their name in CC4 when you include it in the
FROM or JOIN clause?
a. hispanic
b. survey
c. ethkey
d. ethnicity: c. ethkey
4. 4. The DISTINCT command:
a. Is used to compare fields that have similar values
b. Aggregates results based on DISTINCT fields
c. Results in unique values of SELECT fields
d. Separates fields based on the WHERE conditions: c. Results in unique values of SELECT fields
5. 5. Including the table name with the field name (e.g. using products.produc- tid instead of just
productid) is necessary when:
a. The field is a primary key field
b. The field name appears in more than one table that is part of the query
c. The field is in a JOIN clause after ON
d. The field is in a WHERE clause: b. The field name appears in more than one table that is
part of the query
6. 6. When present, the clause should be the
final clause in an SQL query.
a. GROUP BY
b. WHERE
c. HAVING
d. ORDER BY: d. ORDER BY
7. 7. Which of the following queries will return the all the sample Cleveland Clinic website
searches that contained 'CT' (as in CT scan) whether the user entered 'CT' or 'ct' or 'Ct' or 'cT'?
a. WHERE UPPER(search) = 'CT'
, SQL Topic and Exam elaborations
b. WHERE UPPER(search) LIKE 'CT'
c. WHERE UPPER(search) LIKE '%CT%'
d. WHERE search LIKE UPPER('%CT%'): c. WHERE UPPER(search) LIKE '%CT%'
8. 8. SQL is an acronym for:
a. Standard Questioning Language
b. Structured Query Language
c. Simple Query Language
d. Structured Questioning Language: b. Structured Query Language
9. 9. The SQL command WHERE does which of the following?
a. Indicates the tables to be used in the query
b. Lists the names of the fields to be displayed on the screen
c. Limits the records to only those meeting the test condition(s)
d. All of the above: c. Limits the records to only those meeting the test condition(s)
10. 10. Why will these two queries return different averages?
SELECT AVG(unitprice - unitcost) FROM
northwinds.products
SELECT AVG(orderdetails.unitprice - unitcost) FROM
northwinds.orderdetails
JOIN northwinds.products on products.productid = orderdetails.productid
a. They will not return different averages
b. Neither will return an average because a GROUP BY is missing
c. Because products contains actual sales prices and orderdetails contains retail prices
d. Because orderdetails contains actual sales prices and products contains retail prices: d.
Because orderdetails contains actual sales prices and products contains retail prices
11. 11. cc2 is the name of a .
a. Field
b. Database
c. Table
d. Record: b. Database
12. 12. The error message "column ambiguously defined" means:
a. Unaggregated and aggregated fields were used without proper grouping
b. A field or table name was misspelled
c. There is an improper equation or comparison
d. The query includes a field with the same name as a field in another joined