added sql, but not fully designed