一:查询出所有表的键
SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME='you tableName'
二:查询出所有的外键
select * from
(
SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE TABLE_NAME='Data_Product'
) tableTemp
where CONSTRAINT_NAME like 'FK%'
另外表的类型有
'C', 'F', 'PK', 'UQ', 'D'
你可以按键需要来修改