An automated trip through SQL queries