Oracle SQL SQL*Plus functions assignment:

  1. Explain the following SQL and for a given date explain the output that would be produced.
     1  SELECT INITCAP(TO_CHAR(datefst,'fmday'))
     2* FROM donor;
    

  2. Explain the following SQL and for a given date explain the output that would be produced.
      SELECT INITCAP(TO_CHAR(datefst,'fmday'))||', the '||
      2  INITCAP(TO_CHAR(datefst,'fmddspth'))|| ' of ' ||
      3  INITCAP(TO_CHAR(datefst,'fmmonth'))||', ' ||
      4  INITCAP(TO_CHAR(datefst,'fmyyyy'))
      5* FROM donor;
    

  3. Explain the following SQL and show the output that would be produced.
    SQL> SELECT ROUND(MAX(yrgoal/3)), TRUNC(MAX(yrgoal/3)
    2 FROM donor;
    

  4. Do a query that involves a group function.

  5. Do a query that involves another group function.

  6. Do a query that involves a group function where you are grouping on a particular field like jobcode or dept.

  7. Do a query using decode.

  8. Do another query using decode.

  9. Do a query that involves nesting functions to achieve an id. The components of the id should come from 4 different columns in your table and at least some of the components should involve characters embedded in the column.

  10. Explain the difference between single row functions and group functions. Be sure to cover the limitations of what you can select using a group function.