Backend sql queries completed