Q. Give commission of Rs. 500 to all employees who joined in year 1982 (table Empl).


Table ---



Answer =

Update Empl
Set comm = comm + 500
Where hiredate between “1982-01-01” and “1982-12-31” ;

11 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. Update Empl Set comm=comm+500 where year(hiredate)=1982;
    Is it correct??

    ReplyDelete
    Replies
    1. No, formate of writting date (1982) is wrong.

      Delete
    2. paathwala is wrong ... the above mentioned command by the person is also correct......i have checked with the MYSQL

      Delete
  2. No i think because date format in sql is YYYY-MM-DD

    ReplyDelete
  3. update empl
    set comm=comm+500
    where hiredate of empl=1982
    is it correct??

    ReplyDelete
  4. Where date>=1982-01-01
    Is correct

    ReplyDelete
    Replies
    1. No, your query will also include year > 1982.

      Delete
  5. Can it be like Update Empl
    Set comm = comm + 500
    Where hiredate like "1989%";

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post