Home » Other » Training & Certification » basic help (oracle 8)
basic help [message #353364] Mon, 13 October 2008 10:39 Go to next message
ravi25k
Messages: 2
Registered: October 2008
Junior Member
i am a 12 grade student and my teacher gave me 50 query as home work and i am not able to solve 2 query on default emp table. hope you guys will help me.

1)list the employee name and commission and if the employee dous not earn commission put "no commission" label the column comm.

2)list the employee name,hiredate and salary review date, which is the first Monday after six months of service. label the column REVIEW. Format the dates to appear in the format similar to Sunday. The seventh of September 1981.
Re: basic help [message #353366 is a reply to message #353364] Mon, 13 October 2008 10:56 Go to previous messageGo to next message
joicejohn
Messages: 327
Registered: March 2008
Location: India
Senior Member
@ravi25k,

Go through the following links and give a try of your own.

For First Question try to go through DECODE Function

For Second Question try to use ADD_MONTHS Function and NEXT_DAY Function Also refer TO_CHAR Function

Good Luck...
(I hope this will be moved to the Homework & Training Section.)

Regards,
Jo
Re: basic help [message #354437 is a reply to message #353364] Sat, 18 October 2008 22:56 Go to previous messageGo to next message
ravi25k
Messages: 2
Registered: October 2008
Junior Member
how do i get default values for already existing comm value along with no commission, without specifying individual values?

SQL> select ename,decode(comm, NULL,'no commission') from emp

ENAME DECODE(COMM,N
---------- -------------
SMITH no commission
ALLEN
WARD
JONES no commission
MARTIN
BLAKE no commission
CLARK no commission
SCOTT no commission
KING no commission
TURNER
ADAMS no commission
JAMES no commission
FORD no commission
MILLER no commission

14 rows selected.
Re: basic help [message #354442 is a reply to message #354437] Sun, 19 October 2008 00:30 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What do you mean "default values"? Current actual ones?

Also please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.

Regards
Michel
Re: basic help [message #354468 is a reply to message #354437] Sun, 19 October 2008 09:20 Go to previous message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Ravi25k, it appears that you didn't study the DECODE function's documentation carefully enough.
Previous Topic: Oracle 9i Exam
Next Topic: Peoplesoft and JD Edwards Training (merged)
Goto Forum:
  


Current Time: Fri Mar 29 08:13:20 CDT 2024