    CREATE TEMP TABLE temp_movies (
        title VARCHAR(255),
        description TEXT,
        releaseYear INT,
        duration INT,
        ageRating INT,
        releaseDate DATE
    );

    CREATE TEMP TABLE temp_series (
        title VARCHAR(255),
        description TEXT,
        releaseDate DATE,
        ageRating INT,
        totalSeasons INT
    );

    COPY temp_movies FROM 'C:\temp\movies_import.csv' WITH (FORMAT csv, HEADER true, DELIMITER ',');

    COPY temp_series FROM 'C:\temp\series_import.csv' WITH (FORMAT csv, HEADER true, DELIMITER ',');

    INSERT INTO Media (title, description, releaseDate, AgeRating)
    SELECT title, description, releaseDate, ageRating
    FROM temp_movies;

    INSERT INTO Movie (MovieID, Duration)
    SELECT m.ContentID, tm.duration
    FROM Media m
    JOIN temp_movies tm ON m.title = tm.title
    WHERE m.ContentID NOT IN (SELECT MovieID FROM Movie);

    INSERT INTO Media (title, description, releaseDate, AgeRating)
    SELECT title, description, releaseDate, ageRating
    FROM temp_series;

    INSERT INTO Series (SeriesID, TotalSeasons)
    SELECT m.ContentID, ts.totalSeasons
    FROM Media m
    JOIN temp_series ts ON m.title = ts.title
    WHERE m.ContentID NOT IN (SELECT SeriesID FROM Series);