in reply to OT: SQL and me

You could give it a try using DBD::CSV. This way you can formulate your problem in SQL, all data is stored in CSV files and thus accessible to your text editor and if it turns out to be successful and the way you want to go, you can just go for a "proper" database system by just exchanging the driver.