主键和主键约束之间的区别 [英] Difference between primary key and primary key constraint

查看:98
本文介绍了主键和主键约束之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我在面试中被问到了这个问题。

当你在桌子上应用主键时,我相信你的意思是你已经应用了主键约束?



所以两者都一样吗?



我尝试过的事情:



尝试Googline,没有找到特定的

Recently I was asked this question in an Interview.
I beleive when you apply a primary key on a table and that would mean that you have applied a primary key constraint ?

So Definitely Both are same right ?

What I have tried:

Tried Googline, Nothing found specific

推荐答案

几乎没有区别。在您明确声明约束的情况下,您可以根据需要为其命名。只定义主键可以获得自动名称(取决于数据库)。
There is almost no difference. In the case where you explicitly state constraint you can name it however you want. Defining just primary key gets you automatic name (depending on the database).


这篇关于主键和主键约束之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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