JuliaDB cross reference

Disclaimer: I do not know any SQL. JuliaDB seems really straightforward so I’m trying it instead of some SQLish solution (although I suspect that’s what I should be using).

I have a few tables (currently saved as .csv files) with primary keys and some cross references connecting them. I need to iterate over the rows of one table. Each row has a primary ID. I need to find the row that has the same (foreign) ID in a different table. Use the data in that row for finding other rows in other tables etc etc etc…

I’ve found tons of (great) info on how to work with one table, but I couldn’t find (any) info on how to work with multiple tables, cross referencing, etc. I’m solving this now with tons of findfirsts and isequals, but it seems there would be some better solution (I imagine it would have to do with the one2one, one2many, or many2many relationships?) out there.

In one way, there seems to be tons of great easy ways to access specific columns but nothing for the rows. I suspect I’ve missed something obvious since there is an API for specifying which column has the primary key, so surely there should be a way to use that information to find a row with a specific key? Like with a Dict?

Since I haven’t really done any rigorous database management, any light would be helpful …

I think you are looking for joins:
http://juliadb.org/latest/joins/

1 Like

@yakir12 Or do you want to combine the tables horizontally as in “merge”?

https://github.com/JuliaComputing/JuliaDB.jl/issues/150

This seems to do the job (more or less, I need to explore some more).

Not really. The tables do not share the same primary keys. But thanks!!!