Replace sql queries by intent sending