查询数据库的所有表名及主键
select col.table_name,col.column_name from
information_schema.table_constraints tab,
information_schema.constraint_column_usage col
where col.constraint_name = tab.constraint_name
and col.table_name = tab.table_name
and constraint_type = 'primary key'