{"players": {"columns": [[0, "player_id", "INT", 0, null, 1], [1, "first_name", "TEXT", 0, null, 0], [2, "last_name", "TEXT", 0, null, 0], [3, "hand", "TEXT", 0, null, 0], [4, "birth_date", "DATE", 0, null, 0], [5, "country_code", "TEXT", 0, null, 0]], "primary_keys": ["player_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "player_id"]]], "check_constraints": []}, "matches": {"columns": [[0, "best_of", "INT", 0, null, 0], [1, "draw_size", "INT", 0, null, 0], [2, "loser_age", "FLOAT", 0, null, 0], [3, "loser_entry", "TEXT", 0, null, 0], [4, "loser_hand", "TEXT", 0, null, 0], [5, "loser_ht", "INT", 0, null, 0], [6, "loser_id", "INT", 0, null, 0], [7, "loser_ioc", "TEXT", 0, null, 0], [8, "loser_name", "TEXT", 0, null, 0], [9, "loser_rank", "INT", 0, null, 0], [10, "loser_rank_points", "INT", 0, null, 0], [11, "loser_seed", "INT", 0, null, 0], [12, "match_num", "INT", 0, null, 0], [13, "minutes", "INT", 0, null, 0], [14, "round", "TEXT", 0, null, 0], [15, "score", "TEXT", 0, null, 0], [16, "surface", "TEXT", 0, null, 0], [17, "tourney_date", "DATE", 0, null, 0], [18, "tourney_id", "TEXT", 0, null, 0], [19, "tourney_level", "TEXT", 0, null, 0], [20, "tourney_name", "TEXT", 0, null, 0], [21, "winner_age", "FLOAT", 0, null, 0], [22, "winner_entry", "TEXT", 0, null, 0], [23, "winner_hand", "TEXT", 0, null, 0], [24, "winner_ht", "INT", 0, null, 0], [25, "winner_id", "INT", 0, null, 0], [26, "winner_ioc", "TEXT", 0, null, 0], [27, "winner_name", "TEXT", 0, null, 0], [28, "winner_rank", "INT", 0, null, 0], [29, "winner_rank_points", "INT", 0, null, 0], [30, "winner_seed", "INT", 0, null, 0], [31, "year", "INT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "players", "winner_id", "player_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "players", "loser_id", "player_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "rankings": {"columns": [[0, "ranking_date", "DATE", 0, null, 0], [1, "ranking", "INT", 0, null, 0], [2, "player_id", "INT", 0, null, 0], [3, "ranking_points", "INT", 0, null, 0], [4, "tours", "INT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "players", "player_id", "player_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE players (
    player_id INT   PRIMARY KEY,
    first_name TEXT,
    last_name TEXT,
    hand TEXT,
    birth_date DATE,
    country_code TEXT,
    UNIQUE (player_id)
);

CREATE TABLE matches (
    best_of INT,
    draw_size INT,
    loser_age FLOAT,
    loser_entry TEXT,
    loser_hand TEXT,
    loser_ht INT,
    loser_id INT,
    loser_ioc TEXT,
    loser_name TEXT,
    loser_rank INT,
    loser_rank_points INT,
    loser_seed INT,
    match_num INT,
    minutes INT,
    round TEXT,
    score TEXT,
    surface TEXT,
    tourney_date DATE,
    tourney_id TEXT,
    tourney_level TEXT,
    tourney_name TEXT,
    winner_age FLOAT,
    winner_entry TEXT,
    winner_hand TEXT,
    winner_ht INT,
    winner_id INT,
    winner_ioc TEXT,
    winner_name TEXT,
    winner_rank INT,
    winner_rank_points INT,
    winner_seed INT,
    year INT,
    FOREIGN KEY (winner_id) REFERENCES players(player_id),
    FOREIGN KEY (loser_id) REFERENCES players(player_id)
);

CREATE TABLE rankings (
    ranking_date DATE,
    ranking INT,
    player_id INT,
    ranking_points INT,
    tours INT,
    FOREIGN KEY (player_id) REFERENCES players(player_id)
);