<jupyter_start><jupyter_text>Finding out First season played<jupyter_code>first_game = pd.read_sql('''SELECT season_name, city_name, MIN(year) AS `First Game Year`
                            FROM
                                sports_stats,
                                seasons,
                                athletes
                                    INNER JOIN
                                games ON athletes.game_id = games.game_id
                                    INNER JOIN
                                cities ON games.city_id = cities.city_id
                            WHERE
                                seasons.season_id = games.season_id
                            ORDER BY sports_stats_id;''', 
                            con = engine
)
first_game<jupyter_output>season_name  city_name  First Game Year
0      Summer  Barcelona             1896<jupyter_text>How many medals were distributed?<jupyter_code>total_medal = pd.read_sql(
    '''
    SELECT 	
        COUNT(Medal) AS `Total Medal Distributed`
    FROM
	    athlete_events
    WHERE Medal IS NOT NULL;
    ''',
    con = engine
)
total_medal<jupyter_output><empty_output><jupyter_text>Lists of Sports Events played in first game(1896)<jupyter_code>games_list = pd.read_sql(
    '''
    SELECT DISTINCT (sport_name)
    FROM
        sports_stats,
        sports,
        athletes
            INNER JOIN
        games ON athletes.game_id = games.game_id
            INNER JOIN
        cities ON games.city_id = cities.city_id
    WHERE
        games.year = 1896
    ORDER BY sport_name;
    ''',
    con = engine
)
games_list<jupyter_output><empty_output><jupyter_text>We can see that 66 sports were played in first Games in the year 1896  Country with highest players<jupyter_code>games_list = pd.read_sql(
    '''
    SELECT 
        country_name, COUNT(country_name)
    FROM
        Regions
    GROUP BY country_name
    ORDER BY COUNT(country_name) DESC;
    ''',
    con = engine
)<jupyter_output><empty_output><jupyter_text>Some Statistics<jupyter_code>avg_age = pd.read_sql(
    '''
    SELECT 
        AVG(athlete_age) AS `Avg Age`
    FROM
        sports_stats;
    ''',
    con = engine
)
avg_weight = pd.read_sql(
    '''    
    SELECT 
        AVG(athlete_weight) AS `Avg Weight`
    FROM
        sports_stats;
    ''',
    con = engine
)
avg_height = pd.read_sql(
    '''    
    SELECT 
        AVG(athlete_height) AS `Avg Height`
    FROM
        sports_stats;
    ''',
    con = engine
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07287128712871287, 'fraction_numerical': 0.0075247524752475245, 'mean_word_length': 1.7249190938511327, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '370707', 'license': 'MIT', 'n_tokens_mistral': 803, 'n_tokens_neox': 756, 'n_words': 171, 'path': 'Scripts/weel_2_analysis.ipynb', 'repo_name': 'Mega-Barrel/SQL-DataScience-Capstone', 'size': '2525'}