Home > Database > Mysql Tutorial > MySQL查看表相关外键关系sql_MySQL

MySQL查看表相关外键关系sql_MySQL

WBOY
Release: 2016-06-01 13:02:28
Original
898 people have browsed it

刚接手MySQL数据的时候,经常会遇到主外键关系,有没有E-R图来帮助,职能通过SQL来查询:

select
TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
where
REFERENCED_TABLE_NAME = '

';
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template