sql = (
    """
    SELECT date, price
    FROM prices
    WHERE date IN ({s})
        AND id = ?"""
    .format(s={','.join(['?'] * len(dates))}))
curs.execute(sql, dates + [id])
Query Sqlite for multiple arguments at once and handling missing values