Apache Derby 理解引用和外键之间的差异

Apache Derby understanding differences between references and foreign key

我知道外键是约束,引用是子句。

This also confuse me.Although it is mysql but not apache derby

This tells me how foreign key work but still confused for me I found out the answer also has the command like what i said references without foreign key

但我的问题是,如果您可以在不使用外键的情况下创建具有对另一个 table 的引用列的 table,那有什么意义呢? 下面的命令仍然有效

create table newTable(ColumnName varchar(100) references oldTable(ColumnName))

the foreign key example at the bottom of this document use foreign key to make references

任何人都可以帮我看看使用带外键的引用和不使用外键之间的区别

I found out in SQLite if you references without foreign key it is same as references with foreign key is apache derby run in same way?

A "foreign key" 是引用 table 的属性集。 (在许多实现中,人们不得不说 "ordered set of attributes" 因为许多实现也使顺序很重要,但这与理论有偏差。)

引用完整性约束是这样的规则,即出现在外键属性[引用table]中的[值的组合]必须显示为[值的组合]关键属性 [在引用的 table] 中。 ("key attributes" 是术语 "key" 的用法,符合关系理论。它们可能是通过 UNIQUE 子句而不是 KEY 子句声明的,但这只是语法。在理论上,所有声明为唯一的都是键。)

"REFERENCES" 子句是[最流行/最常用] 声明引用完整性约束的方式。这是一种句法手段。它总是包含外键的规范,但另外它还定义了引用的 table 及其引用的属性。

因为基于 SAME 外键(例如,两个不同的引用 table )存在两个不同的参照完整性约束是非常罕见的,它所有这些术语可以互换使用是很常见的。