I think what you are looking for is a CAML query.
You can actually update or insert items into SharePoint using a CAML. Do a search here on CAML and you can find some instructions.
Otherwise you would need to use a Business Data Catalog in Sharepoint to try and link to your database data.
Another option, is if you have data in SQL, is to use SQL reports to create web reports which you can embed in SharePoint.