About 527,000 results
Open links in new tab
  1. sql - Should I use foreign keys? - Stack Overflow

    Dec 10, 2012 · Foreign key's don't actually improve performance, in fact they incur a small performance penalty on all write operations, to ensure that the constraint is followed. The …

  2. sql - Joining tables on foreign key - Stack Overflow

    3 I have the following three tables: Product Purchase (contains ProductID as foreign key) Sale (contain ProductID as foreign key as well) I want to form query joining these 3 tables where my …

  3. How to use foreign key when querying from two tables

    Apr 12, 2013 · 16 My question is quite basic. It is about how can i build my query with using a foreign key to select certain information from two tables?

  4. Why are foreign keys necessary in a database design?

    Foreign keys help the programmer to manipulate data. If a programmer is doing this already, then do we need the concept of foreign keys? What are other uses for foreign keys? What am I …

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

    Jun 11, 2012 · It is perfectly fine to use a foreign key as the primary key if the table is connected by a one-to-one relationship, not a one-to-many relationship. If you want the same user record …

  6. Does Foreign Key improve query performance? - Stack Overflow

    Foreign key constraint improve performance at the time of reading data but at the same time it slows down the performance at the time of inserting / modifying / deleting data. In case of …

  7. How do I create a foreign key in SQL Server? - Stack Overflow

    I have never "hand-coded" object creation code for SQL Server and foreign key decleration is seemingly different between SQL Server and Postgres. Here is my sql so far: drop table …

  8. Foreign key referencing a 2 columns primary key in SQL Server

    Jul 5, 2010 · ADD CONSTRAINT FK_Content_Libraries FOREIGN KEY(LibraryID, Application) REFERENCES dbo.Libraries(ID, Application) Is that what you're using?? If (ID, Application) is …

  9. sql - Foreign Keys vs Joins - Stack Overflow

    Jun 1, 2010 · primary-key, foreign -key are used to maintain data consistency. If u want data from more than 1 tables in single query, then u can use JOINS. So Joins is independent on PK-FK …

  10. How do I use cascade delete with SQL Server? - Stack Overflow

    To add "Cascade delete" to an existing foreign key in SQL Server Management Studio: First, select your Foreign Key, and open its "DROP And CREATE To.." in a new Query window. …