Write a SELECT statement that returns these columns from the Vendors table:
- The vendor_name column
- The vendor_name column in all capital letters
- The vendor_phone column
- The last four digits of each phone number
When you get that working right, add the columns that follow to the result set. This is more difficult because these columns require the use of functions within functions.
- The second word in each vendor name if there is one; otherwise, blanks
- The vendor_phone column with the parts of the number separated by dots as in 555.555.5555
this is what i have tried so far:
select vendor_name, UPPER(vendor_name) AS VENDOR_NAME_UPPER,
vendor_phone, SUBSTR(vendor_phone, 11, 4),
Replace
(replace
(replace(vendor_phone, ') ', '.')
, '(', '')
, '-','.') AS vendor_phone_dot,
SUBSTR(vendor_name, (INSTR(vendor_name, ' ') + 1)) AS Second_Word
from vendors;