Inserting and updating data with UPSERT

    Add data to the table using UPSERT INTO:

    Note

    We assume that you already created tables in step Creating a table and populated them with data in step Adding data to a table.

    UPSERT INTO episodes
    (
        series_id,
        season_id,
        episode_id,
        title,
        air_date
    )
    VALUES
    (
        2,
        5,
        13,
        "Test Episode",
        CAST(Date("2018-08-27") AS Uint64)
    )
    ;
    
    COMMIT;
    
    -- View result:
    SELECT * FROM episodes WHERE series_id = 2 AND season_id = 5;
    
    COMMIT;