Hi,
To use CAML, you have to call "SPQuery" class from sharepoint object model. Here is some useful link to create CAML query. You can also find lots of material from internet.
http://sharepointmagazine.net/articles/writing-caml-queries-for-retrieving-list-items-from-a-sharepoint-list
http://camlquery.codeplex.com/
>link database in sharepoint
can you explain it bit more what exactly you are looking for. If you want to get record from DB (SQL, Oracle etc) using CAML then it will not possible in sharepoint. You can only retrive content form iste through CAML.
Hope it could help
Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"