DP_1_3_Solution_w
DP_1_3_Solution_w
Try It / Solve It
2. Write a query that displays the last_name and email addresses for all the people in the DJs
on Demand d_client table. The column headings should appear as “Client” and “Email
Address.”
Solution: SELECT last_name, salary *1.05 +.50 or (salary *1.05) +.50 FROM f_staffs ;
4. Which of the following would be the easiest way to see all rows in the d_songs table?
a. SELECT id, title, duration, artist, type_code
b. SELECT columns
c. SELECT *
d. SELECT all
Solution: SELECT *
5. If tax = 8.5% * car_cost and license = car_cost * .01%, which value will produce the largest
car payment?
a. Payment = (car_cost * 1.25) + 5.00 - (tax) - (license)
b. Payment = car_cost * 1.25 + 5.00 - (tax - license)
Solution: Payment = car_cost * 1.25 + 5.00 - (tax - license) substitute 10.00 for car_cost to demo
answer.
6. In the example below, identify the keywords, the clause(s), and the
Solution:
2 Keywords: SELECT & FROM
2 Clauses: SELECT employee_id, last_name & FROM employees
1 Statement: Both lines combined
2
7. Label each example as SELECTION or PROJECTION
a. Please give me Mary Adam's email address.
b. I would like only the manager_id column, not any of the other columns.
Solution:
a. Please, give me Mary Adam's email address. SELECTION
b. I would like only the manager_id column, not any of the other columns. PROJECTION
10. Which of the following words must be in a SELECT statement in order to return all rows?
a. SELECT only
b. SELECT and FROM
c. FROM only
d. SELECT * only