Added SQL queries into analyze_tar