using sqlite3 to create join for rkt