I'm trying to join two tables using SQLite according to unique case id numbers.
If I try running this..
SELECT *
FROM collisions c
INNER JOIN parties p ON c.case_id = p.case_id
WHERE date(collision_date) BETWEEN date('2020-01-01') and date('2021-12-31')
I get an error saying database/disk is full.
I manage to get by creating two databases based on unique ID number, as such..
query_two = """
SELECT *
FROM parties
WHERE date(case_id) BETWEEN '3982887' and '3984887'
"""
query = """
SELECT *
FROM collisions
WHERE date(case_id) BETWEEN '3982887' and '3984887'
"""
and merging them together like this
concat = pd.merge(df_one, df_two, on = 'case_id', how = 'inner')
But this gives me a random sample and it so happens that these case ids include collisions from 2007.
I want to be more specific and join only cases with a specific date range of 2020-01-01 to 2021-12-31.
Note: The parties table doesn't have collision_date - so the only way to join both tables is on case_id.
Is there a workaround to this?
Thanks!