Marcus Steen
asked on
What does this table internal reference mean?
Hi!
I am studying and trying to rebuild an example from this page: https://www.toptal.com/sql/interview-questions I Understand the reference between the primary key in table Customers and Id in table Invoices. But I don´t understand what the relation between the primary key Id and the field RefferedBy means?
I want to know so I can create examples to make sure that I really understand the sql-code in the example from the page.
Regards
I am studying and trying to rebuild an example from this page: https://www.toptal.com/sql/interview-questions I Understand the reference between the primary key in table Customers and Id in table Invoices. But I don´t understand what the relation between the primary key Id and the field RefferedBy means?
I want to know so I can create examples to make sure that I really understand the sql-code in the example from the page.
Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That's a FK that's reference a PK in the same table so you can use the same statement as you're using for relationship creation. If you have doubts please read this MSDN article that explains about creating FKs.
ASKER