Can we link SQL queries to our web automation run?

Yes. I see two options: