added python scripts and modified sql queries accordingly