trying to make the sql, but FAILING...