About 164,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. 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 …

  3. sql - What is the difference between primary, unique and foreign …

    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.

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

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

  5. sql - difference between secondary key, foreign key, and primary …

    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 …

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

    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).

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

    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 …

  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 …

  9. sql - Can the same column have primary key & foreign key …

    Sep 23, 2010 · Table1: ID - Primary column, foreign key constraint for Table2 ID Table2: ID - Primary column, Name Will this be an issue if i try to delete table1 data?

  10. sql - can we have a foreign key which is not a primary key in any …

    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 …