Generate level from database.