SECTION 2 LESSON 1
1. List the last names and birthdays of Global Fast Food Employees. Convert the birth dates to character data in the Month DD, YYYY format. Suppress any leading zeros.
----select last_name,to_char(birthdate,'fxMonth DD, YYYY')
2. Convert January 3, 2004, to the default date format 03-JAN-04.
----select to_date('January 3, 2004','DD MON,YYYY')
3. Format a query from the Global Fast Foods f_promotional_menus table to print out the start_date of promotional code 110 as: The promotion began on the tenth of February 2004.
----select 'The promotion began on the'//To_char(start_date,'ddth')' of 'to_char(start_date,'Month YYYY')
4. Convert today's date to a format such as: "Today is the Twentieth of March, Two Thousand Four"
----select 'Today is the'//' '//to_char(sysdate,'Ddspth')//' of '//to_char(sysdate,'MONTH')//', '//to_char(sysdate,'YEAR')
5. List the ID, name and salary for all Global Fast Foods employees. Display salary with a $ sign and two decimal places.
----select employee_id,first_name' 'last_name,to_char(salary,'$999999.99')
6. Ellen Abel is an employee who has received a $2,000 raise. Display her first name and last name, her current salary, and her new salary. Display both salaries with a $ and two decimal places. Label her new salary column AS New Salary.
----select first_name,last_name,salary,to_number(salary+2000,'$999999.99')+2000 as "New Salary"
7. On what day of the week and date did Global Fast Foods?promotional code 110 Valentine's Special begin?
8. Create one query that will convert 25-DEC-04 into each of the following (you will have to convert 25-DEC-04 to a date and then to character data):
december 25th, 2004
----select To_char('20-dec-04','Month ddth,YYYY')
----select to_char('20-dec-04','MONTH ddTH,YYYY')
----select to_char('20-dec-04','month ddth,YYYY')
9. Create a query that will format the DJ on Demand d_packages columns, low-range and high-range package costs, in the format $2500.00.
10. Convert JUNE192004 to a date using the fx format model.