Forum Topic

SQLITE3

  • I have a question regarding combining data among database files.
    So I have the ff database files for example
    d1.db
    d2.db
    d3.db
    d4.db

    Each database file I have ta table, so
    d1.db has ta table
    d2.db has ta table
    d3.db has ta table
    d4.db has ta table

    The format or columns of each database file is the same, but have different values.
    Say d1.db, table ta
    Name, Address, age
    a, zz, 24
    b, z7, 35


    d2.db, table ta
    Name, Address, age
    aa, n1, 17
    bb, t5, 42


    Typical for d3.db and d4.db (same columns but different values)

    Note the rows in each table is not necessarily 2 entries only.

    I want to combine those data into 1 database file and 1 table, say
    all.db on table tz, which would look like the ff.
    Name, Address, age
    a, zz, 24
    b, z7, 35
    aa, n1, 17
    bb, t5, 42
    ..., ..., ...
    ..., ..., ...
    ..., ..., ...
    ..., ..., ...


    I am using SQLITE command-line tool, how can I combine these tables automatically (if possible).
    Or perhaps there are other free tools where I can combine this easily.
    But I prefer command-line tools for possible batch commands processing.

    Thank you.
  • I am not aware of any tools regarding this but this can easily be done using python.
  • Thanks, I will look into that.