sql and twitter implementation