Hi,
First of all I would recommend you to read through following article about how to use SQL commands:
http://www.sql-tutorial.net/Then it really depends how you want to communicate with your tables. If you want to use C# codes for this purpose, you can use standard ADO.NET support:
http://msdn.microsoft.com/en-us/library/h43ks021V(S.71).aspx
However, Kentico CMS comes also with some pre-defined web parts which are capable of performing custom queries over database (your tables.) If you could provide us with more detail information on what exactly are you trying to achieve we can give you more appropriate answer.
Best Regards,
Miroslav Remias.