[PD] extended sql and py