/* Find all columns names 'course_id' across multiple tables */ SELECT pr.name as column_name, sm.name as table_name FROM sqlite_master sm LEFT JOIN pragma_table_info(sm.name) pr ON sm.name != pr.name WHERE pr.name LIKE '%course_id%' ORDER BY 2; /* Find all columns having the same name across multiple tables */ SELECT pr.name as column_name, sm.name as table_name FROM sqlite_master sm LEFT JOIN pragma_table_info(sm.name) pr ON sm.name != pr.name ORDER BY 1,2;