In SQLite 3, I'd like to build a piece of SQL (or otherwise - as long as I can execute it with a basic SQLiteStudio install for example) that can read from all the tables in a given db, and list their fields and how many times they appear across all the tables (based on their names).
example:
First table: Person
Fields:
- PersonID
- First Name
- Last Name
Second table: Address
Fields:
PersonID
Street
After running the code I'd have a third table called, for example, fields_list, like such:
Field: / Count:
PersonID / 2
First Name / 1
Last Name / 1
Street / 1
Any idea? I'm ok with pure SQL but this sort of looping through the tables themselves is way above what I can do I'm afraid...
thanks in advance!
Andre