About 441,000 results
Open links in new tab
  1. 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?

  2. sql - What is the difference between primary, unique and foreign key ...

    Nov 7, 2009 · What is the difference between primary, unique and foreign key constraints, and indexes? I work on Oracle 10g and SQL Server 2008.

  3. 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 …

  4. sql - Зачем нужен PRIMARY KEY и FOREIGN KEY (ключи)? - Stack …

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

  5. 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 …

  6. sql - difference between secondary key, foreign key, and primary key ...

    Jun 1, 2018 · Primary Key: Is a single field chosen by the designer to uniquely identify a record in a table (relation), cannot be null (empty/unassigned). Foreign Key: Is the Primary Key one table appearing …

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

    Without that primary key, many rows could have the same ID value and you wouldn't be able to distinguish between them based on the ID value alone. A foreign key enforces the consistency of …

  8. sql - What is the difference between a primary key and a surrogate key ...

    Apr 21, 2016 · A primary key is the identifying column or set of columns of a table. Can be surrogate key or any other unique combination of columns (for example a compound key).

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

    May 24, 2010 · By definition a foreign key must reference a candidate key of some table. It doesn't necessarily have to be the primary key. As a matter of detail the constraint called a FOREIGN KEY in …

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

    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 …