graph reads from sql database