MySQL中引用和联接的持久性是什么? [英] What is the permanence of references and joins in MySQL?

查看:50
本文介绍了MySQL中引用和联接的持久性是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

加入"有什么作用?我在phpMyAdmin中找不到任何辅助键",只有主键.即使我经常在书中读到它们,但它们似乎是实例化的或环境的,而不是永久的.换句话说,联接"是否仅存在于选择中,或者当存在JOINREFERENCE时,数据库结构本身是否会更改?

What does 'joining' do? I can't find any 'secondary key' in phpMyAdmin..., only primary keys. Even though I often read about them in my books, they seem like to be instantiated or environmental, rather than permanent. In other words, do 'joins' only exist in selects, or does the database structure itself change when there is a JOIN or a REFERENCE?

推荐答案

JOIN是一种抽象方法(也就是说,物理上并不存在于数据库中),仅在相关查询期间发生(无双关语). JOIN用于跨越多个相互引用的表的查询. *加入JOIN无需参考. JOIN所做的只是简单地联接目标表,从而为您提供了更广泛的数据集,可从中选择值.

A JOIN is an abstract method (i.e., it's nothing that physically exists in the database) that occurs only during the query in question (no pun intended). JOIN is used in queries that span several tables that have references to each other. *It is not necessary to have references for a JOIN to work. What JOIN does is simply joins targeted tables, giving you a broader data set to select values from.

常见的联接类型为内联接",外联接",左联接",右联接"和交叉联接".

Common types of joins are INNER JOIN, OUTER JOIN, LEFT JOIN, RIGHT JOIN and CROSS JOIN. The one used in your previous question was a CROSS JOIN, although the keyword itself was left out. That is: SELECT A.name, B.name FROM table1 A, table2 B--an implicit cross join. SELECT A.country, B.country FROM iteration1 A CROSS JOIN iteration2 B is explicit. It's just a matter of taste.

通常,联接会创建大型数据集,并且您需要分配查询(使用WHERE或类似方法)以提取所需的数据.

Generally, joins create large data sets, and you need to pinout your queries (using WHERE or similar) to extract the data you are looking for.

这篇关于MySQL中引用和联接的持久性是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆