Hi Ronnie,
Developing an application like your intended one is very easy.
Step 1: Choose your database
You should choose whatever your comfortable with as it won't make a difference. The only thing which you have to ensure is correct indexing to ensure the querying is as fast as possible.
Step 2: Prepare the querying aspect of the script
You need to put together a script which will parse an http query string and query the database. Simply put, you need to be able to feed a dummy message into the script through the URL and then parse the message, validate it and then query the database.
Step 3: Enable sms delivery
Once you've extracted your required data, you need to put the message sending part in place. At this stage, you should still be using dummy data fed through the url.
Step 4: Enable sms reception
Once your application is working with dummy data, you need to get your incoming messages to be forwarded to your script using the same parameter that you've been using so far. Previously, your application was working with dummy data, but now it will be working with true data.
As for how you actual messaging, the fastest, least challenging and (usually) most affordable route is to use an existing service provider.
I hope that helps and am happy to keep helping till your application goes live.