Friday, February 24, 2006

SECTION 1 LESSON 3
1. For DJ on Demand, display the number of months between the event_date of the Vigil wedding and today's date. Round to the nearest month.

----select round(month_between(event_date,sysdate),0)
from d_events
where name=Vigil wedding;

2. Display the days between the start of last summer's school vacation break and the day school started this year. Assume 30.5 days per month. Name the output "Days."

----select round(months_between('13-Sep-05','25-Jun-05')*30.5,0) "Day"

from dual
3. Display the days between January 1 and December 31.

----select (months_between('01-JAN-06','31-DEC-06')/12)*365
from dual;

4. Using one statement, round today's date to the nearest month and nearest year and truncate it to the nearest month and nearest year. Use an alias for each column.

----select round(sysdate,'month') "nearest month", round(sysdate,'year') "nearest year", trunc(sysdate,'month') "Nearest Month", trunc(sysdate,'year') "Nearest Year"

from dual;
5. What is the last day of the month for June 2005? Use an alias for the output.

----select last_day('01-JUN-05')
from dual;

6. Display the number of years between the Global Fast Foods employee Bob Miller's birthday and today. Round to the nearest year.

----select round(months_between(sysdate,birthday)/12,'year')
from f_staffs
where first_name='Bob';

7. Your next appointment with the dentist is six months from today. On what day will you go to the dentist? Name the output, "Appointment."

----select add_months(sysdate,6) as"Appointment"
from dual;
(Appointment: 24-8月 -06)

8. The teacher said you have until the last day of this month to turn in your research paper. What day will this be? Name the output, "Deadline."

----select last_day(sysdate)as "Deadline"
from dual;
(Deadline: 28-2月 -06)

9. How many months between your birthday this year and January 1 next year?

----select months_between('27-MAY-06','01-JAN-07')
from dual;

10. What's the date of the next Friday after your birthday this year? Name the output, "First Friday."

----select next_day('27-MAY-06','friday')as"First Friday"
from dual;

11 Comments:

Blogger Henry Ruan said...

Look like you are doing well now. Is this something that you like to do?

2:22 PM  
Blogger Henry Ruan said...

Look like you are doing well now. Is this something that you like to do?

2:22 PM  
Blogger 大葱~~~~~~~ said...

maybe, i want to work harder and harder on my study, to be a good student,good good study, day day up,haha...

4:46 PM  
Blogger Ridhima said...


All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.


Java training in Adyar

7:49 AM  
Blogger Xplorant Seo said...

Wonderful blog.. Thanks for sharing informative blog.. its very useful to me..

iOS Training in Chennai

2:35 AM  
Blogger john stany said...


Nice it seems to be good post... It will get readers engagement on the article since readers engagement plays an vital role in every blog.. i am expecting more updated posts from your hands.
Android App Development Company

11:39 PM  
Blogger Sharon Sandy said...

great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
web design Company
web development Company
web design Company in chennai
web development Company in chennai
web design Company in India
web development Company in India

11:01 PM  
Blogger john stany said...

I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
iOS App Development Company
iOS App Development Company

1:11 AM  
Blogger isabella jacob said...

it is really amazing...thanks for sharing....provide more useful information...
Mobile app development company

1:13 AM  
Blogger louis philip said...

I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.

Fitness SMS
Fitness Text
Salon SMS
Salon Text
Investor Relation SMS
Investor Relation Text

4:25 AM  
Blogger Sharon Sandy said...

great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
web design Company
web development Company
web design Company in chennai
web development Company in chennai
web design Company in India
web development Company in India

12:24 AM  

Post a Comment

<< Home