About 257,000 results
Open links in new tab
  1. What is the difference between primary, unique and foreign key ...

    Nov 7, 2009 · Primary/foreign : A "primary" key is a set of attributes whose values must form a combination that is unique in the entire table. There can be more than one such set (> 1 key), and …

  2. Is it fine to have foreign key as primary key? - Stack Overflow

    Jun 11, 2012 · Primary keys always need to be unique, foreign keys need to allow non-unique values if the table is a one-to-many relationship. It is perfectly fine to use a foreign key as the primary key if …

  3. Зачем нужен PRIMARY KEY и FOREIGN KEY (ключи)?

    Dec 15, 2022 · Помимо вышеуказанных причин приведу ещё одну: PRIMARY KEY и FOREIGN KEY зачастую индексируются. Это приводит к тому, что обращение по ним будет происходить …

  4. SQL - Unique Key, Primary Key & Foreign Key - Stack Overflow

    Apr 25, 2015 · What are the differences between Unique Key, Primary Key and Foreign Key with respect to concept of SQL? How they are different from each other?

  5. sql - can we have a foreign key which is not a primary key in any other ...

    It is only possible if foreign key refers any column uniquely in other table. That means foreign key must be the candidate key in other table and primary key is also a candidate key the table.

  6. What is a simple example to explain what a foreign key is?

    3 A foreign key is a column in one table that should uniquely identify something in another table. Thus, the values should correspond to primary keys in that other table. For example, if you have a table of …

  7. database - Does a foreign key need to reference a primary key or ...

    Oct 28, 2016 · A foreign key must refer to an unique key (a primary key is unique), because if it doesn't, it cans be the reference of 2 lines, and it's just impossible for a foreign key.

  8. sql - Foreign Key to non-primary key - Stack Overflow

    Aug 26, 2013 · 278 If you really want to create a foreign key to a non-primary key, it MUST be a column that has a unique constraint on it. From Books Online: A FOREIGN KEY constraint does not have to …

  9. sql - Why is a primary-foreign key relation required when we can join ...

    Primary and foreign keys are about normalization and referential integrity first, JOIN second. If you don't know why you need a primary key for every row in a table, then you shouldn't be using relational …

  10. Diferença e utilização entre Primary Key e Foreign Key

    Jan 15, 2019 · Fiz uma modelagem do banco de dados relacionando algumas tabelas e no final de tudo foi me dito que estava errado por não possuir as chaves PK e FK. A questão é, como eu diferencio …