Assignment 2

In line functions

Instructions

Read the following and write the SQL that would provide the data to answer the question. Turn in the SQL. I don't necessarily need the results unless I specifically request it. Alias all columns that contain functions


1. Return all the person names as a single column named "contact". The field should show the name as [Last name, Firs tname], without the brackets of course.

2. Return the hire date for each employees so that it looks like "Jan 1 2010<" and return the social security number with dashes like [###-##-####]

3. List all the donation dates and amounts. Format the date like "Jan 2 2010" and put a"$" sign on the money amounts.

4. Return PersonKey and the telephone numbers in the contact. Format the telephone number like [(2026)555-1234]

5. List the days that donations were made in march

5. Find the difference in months between when employee 1 was hired and when the employee 4 was hired.

6. List all the donations less than $100 in reverse order.

7. Return the Date, amount and service key for each Grant. Use a switch to add a column that gives the service name for each the servicekey.

8. Change the nulls in Employee dependents to the word "none".