• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

an UPDATE query question.

 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A department entity is in a one to Many relationship with the Employee entity. A developer has been asked to write a query to update the set of employees who are in the department HR by setting their department to null.
Syntax fragments:

Set
e.department.name
('HR')
where
e.department
=null
Employee e
Update
IN

According to me its:
Update Employee e Where ('HR') IN e.department.name Set e.department=null

Please tell me how should the query be formed.
And any links for further learning such query formation would be appreciated.


thanks,
mallika
 
mallika shah
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please Please need Help with this question..

A department entity is in a one to Many relationship with the Employee entity. A developer has been asked to write a query to update the set of employees who are in the department HR by setting their department to null.
Syntax fragments:

Set
e.department.name
('HR')
where
e.department
=null
Employee e
Update
IN

According to me its:
Update Employee e Where ('HR') IN e.department.name Set e.department=null

Please tell me how should the query be formed.
And any links for further learning such query formation would be appreciated.


thanks,
mallika
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[deleted]

I guess its an assignment question.
[ January 04, 2008: Message edited by: Adeel Ansari ]
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Update Employee e Set e.department=null Where e.department.name IN ('HR')

In is like SQL IN operator which check the specified values are in the right hand side list. The right hand side is usually the Fix set of values.

Where is the optional filtering condition. It should come to the last.

Thanks
 
mallika shah
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Narendra for the Reply..
 
reply
    Bookmark Topic Watch Topic
  • New Topic