Almost all SharePoint developers will know about the U2U CAML Query tool, I just thought I’d throw a little link love their way.
If you live under a rock, this tool provides a nice GUI for you to generate those nasty CAML queries:
This is a fantastic tool, I have no doubt that it will save you plenty of time.
Just remember to remove the <Query> opening and closing tags before you use it in your code.