
import sqlite3
import pandas as pd

L3_DB_PATH = 'database/L3/L3_Features.sqlite'

def verify():
    conn = sqlite3.connect(L3_DB_PATH)
    
    # 1. Row count
    cursor = conn.cursor()
    cursor.execute("SELECT COUNT(*) FROM dm_player_features")
    count = cursor.fetchone()[0]
    print(f"Total Players in L3: {count}")
    
    # 2. Sample Data
    df = pd.read_sql_query("SELECT * FROM dm_player_features LIMIT 5", conn)
    print("\nSample Data (First 5 rows):")
    print(df[['steam_id_64', 'total_matches', 'basic_avg_rating', 'sta_last_30_rating', 'bat_kd_diff_high_elo', 'hps_clutch_win_rate_1v1']].to_string())
    
    # 3. Stats Summary
    print("\nStats Summary:")
    full_df = pd.read_sql_query("SELECT basic_avg_rating, sta_last_30_rating, bat_win_rate_vs_all FROM dm_player_features", conn)
    print(full_df.describe())
    
    conn.close()

if __name__ == "__main__":
    verify()
