inserts mass data into a relational database while handling relationships