Con information_schema puedes obtener algunos datos. Mira algunos ejemplos.
Código MYSQL:
Ver original+----------+--------------+------+-----+---------+----------------+
+----------+--------------+------+-----+---------+----------------+
+----------+--------------+------+-----+---------+----------------+
+-----------+-------------+------+-----+---------+-------+
+-----------+-------------+------+-----+---------+-------+
| numhab
| int(2) | NO | | | | | numparq
| int(10) | NO | | | | +-----------+-------------+------+-----+---------+-------+
mysql
> select constraint_name
,constraint_type
,table_name
,table_schema
from information_schema.table_constraints
where table_name
= 'cobros' and table_schema
='sgh';+-----------------+-----------------+------------+--------------+
| constraint_name | constraint_type | table_name | table_schema |
+-----------------+-----------------+------------+--------------+
+-----------------+-----------------+------------+--------------+
mysql
> select constraint_name
,constraint_type
,table_name
,table_schema
from information_schema.table_constraints
where table_name
= 'unidad' and table_schema
='sgh';+-----------------+-----------------+------------+--------------+
| constraint_name | constraint_type | table_name | table_schema |
+-----------------+-----------------+------------+--------------+
+-----------------+-----------------+------------+--------------+
mysql
> select count(*) conteo
from information_schema.table_constraints
where table_name
= 'cobros' and table_schema
='sgh' and constraint_type
='FOREIGN KEY';+--------+
| conteo |
+--------+
| 1 |
+--------+
mysql>