In SharePoint 2007, there was an useful tool to design and create new CAML queries: it was U2U CAML Query Builder.
Sadly it hasn't been updated for SharePoint 2010, and it seems that it is not available anymore.
The blog post U2U CAML Query Builder for SharePoint 2010? suggests two tricks:
- connect the old CAML query builder (for SharePoint 2007) to SharePoint 2010 via web services;
- design the new query with LINQ to SharePoint, then trace its output as described in my previous article Linq to SharePoint 2010: how trace the CAML query.
Alternatively, it would be possible to use the CAML.NET library, to build CAML queries in a type-safe way.
Finally: the StackOverflow question U2U Caml Query Builder no longer available? suggests to use the following tools: