`
zengshaotao
  • 浏览: 756250 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

查看依赖当前表的外键的表的集合

 
阅读更多

当我们想查看一个数据库表有多少其他表通过外键依赖这个表的时候,可以通过可视化的工具来看,当没有工具可以使用的时候,可以通过如下的sql查询来完成:


select    
    concat(table_name, '.', column_name) as 'foreign key',     
    concat(referenced_table_name, '.', referenced_column_name) as 'references'  
from  
    information_schema.key_column_usage   
where  
    table_schema='$databasename' and  
    referenced_table_name is not null;  

 

其中'$databasename' 要替换成您要查询的那个数据库的名称。

分享到:
评论

相关推荐

    数据库设计理论.doc

    关系模型:用二维表来表示实体集,用外键来表示实体间的联系,这样的数据模型,叫 做关系数据模型。 关系模型包含内涵和外延两个方面: 外延:就是关系或实例、或当前值。它与时间有关,随时间的变化而变化。(主要...

    SQL培训第一期

    2.1.6.1 查看锁表信息 select l.OBJECT_ID,s.SID,s.SERIAL#,s.USERNAME, s.MACHINE from V$locked_Object l,V$session s where l.SESSION_ID = s.SID; 2.1.6.2 解锁 alter system kill session 'sid,serial#'; 2.1.7...

    基于Android的毕业论文管理系统的设计与研究.docx

    (三)数据库逻辑结构设计 数据库结构设计之后,就要将上面的数据库概念模型转化成数据库系统所支持的实际数据模型,也就是数据库的逻辑结构本系统采用的是MySQL数据库,定义管理员表、普通用户表、论文表、题目表...

    Hibernate中文详细学习文档

    6.2.1. 集合外键(Collection foreign keys) 6.2.2. 集合元素(Collection elements) 6.2.3. 索引集合类(Indexed collections) 6.2.4. 值集合于多对多关联(Collections of values and many-to-many associations)...

    Hibernate_3.2.0_符合Java习惯的关系数据库持久化

    6.2.1. 集合外键(Collection foreign keys) 6.2.2. 集合元素(Collection elements) 6.2.3. 索引集合类(Indexed collections) 6.2.4. 值集合于多对多关联(Collections of values and many-to-many associations)...

    Hibernate参考文档

    6.2.1. 集合外键(Collection foreign keys) 6.2.2. 集合元素(Collection elements) 6.2.3. 索引集合类(Indexed collections) 6.2.4. 值集合于多对多关联(Collections of values and many-to-many associations) ...

    Hibernate+中文文档

    6.2.1. 集合外键(Collection foreign keys) 6.2.2. 集合元素(Collection elements) 6.2.3. 索引集合类(Indexed collections) 6.2.4. 值集合于多对多关联(Collections of values and many-to-many associations)...

    hibernate 体系结构与配置 参考文档(html)

    集合外键(Collection foreign keys) 6.2.2. 集合元素(Collection elements) 6.2.3. 索引集合类(Indexed collections) 6.2.4. 值集合于多对多关联(Collections of values and many-to-many associations) ...

    HibernateAPI中文版.chm

    6.2.1. 集合外键(Collection foreign keys) 6.2.2. 集合元素(Collection elements) 6.2.3. 索引集合类(Indexed collections) 6.2.4. 值集合于多对多关联(Collections of values and many-to-many associations)...

    Hibernate 中文 html 帮助文档

    6.2.1. 集合外键(Collection foreign keys) 6.2.2. 集合元素(Collection elements) 6.2.3. 索引集合类(Indexed collections) 6.2.4. 值集合于多对多关联(Collections of values and many-to-many associations) ...

    hibernate3.2中文文档(chm格式)

    6.2.1. 集合外键(Collection foreign keys) 6.2.2. 集合元素(Collection elements) 6.2.3. 索引集合类(Indexed collections) 6.2.4. 值集合于多对多关联(Collections of values and many-to-many associations)...

    oracle学习文档 笔记 全面 深刻 详细 通俗易懂 doc word格式 清晰 连接字符串

    在创建表时,经常会创建该表的主键、外键、唯一约束、Check约束等  语法结构 create table 表名( [字段名] [类型] [约束] ……….. CONSTRAINT fk_column FOREIGN KEY(column1,column2,…..column_n) ...

    jpivot学习总结.doc

    primaryKeyTable 如果成员表不只一个,而是多个表通过 join 关系形成的,那么就要通过这个属性来指明 join 的这些表中,哪一个与 Dimension 里设置的 foreignKey 属性形成外键关系。通过该属性来指明主表 caption ...

    领域驱动设计与模式实战

    4.3.2 简单UI的当前焦点 4.3.3 为客户列出订单 4.3.4 添加订单 4.3.5 刚才我们看到了什么 4.4 另一个维度 4.4.1 领域模型的位置 4.4.2 孤立或共享的实例 4.4.3 有状态或无状态领域模型实例化 4.4.4 领域模型的完整...

    hibernate_reference中文文档.pdf

    1.2.4. 值类型的集合 ................................................... 17 1.2.5. 双向关联 ....................................................... 18 1.2.6. 使双向连起来 .................................

Global site tag (gtag.js) - Google Analytics