I wouldn't use the post-commit hook - it runs while the developer is committing to SVN, and you really want your commits to be as fast and painless as possible. That makes it hard to deal with inevitable situations where the database action is slow, or fails, or can't connect to the database or whatever.
Instead, I'd look at setting up a continuous integration server to monitor SVN, and run whatever scripts you want to for each commit.
As for "how" - either write a native application to run the database query, passing in the parameters on the command line, or use whatever scripting language your platform supports to execute the database queries. Powershell on Windows, pretty much anything on *nix...