sql databse relationships architecture?

Arslan Abbasi 21 Reputation points

Hi im arslan ,
i have seen first time ever sql database tables working without foreign key relation in big project .
what is the best practise to use relational database ,1 with foreign keys . 2 without foreign keys?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,584 questions
0 comments No comments
{count} votes

Accepted answer
  1. YufeiShao-msft 7,051 Reputation points

    Hi @Arslan Abbasi ,

    Foreign key.
    Foreign key constraints are as essential to a relational database as are tables and columns
    The obvious problem with the lack of foreign keys is that a database can not enforce referential integrity, and tables relations are not clear


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

1 additional answer

Sort by: Most helpful
  1. Erland Sommarskog 100.7K Reputation points MVP

    With foreign keys!

    There are people who say "oh, we manage this in the application". Which often results in orphan rows and other sorts of inconsistencies.