Link to home
Start Free TrialLog in
Avatar of Marcus Steen
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? User generated image
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
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Marcus Steen
Marcus Steen

ASKER

Ok, but how do I write this when I create the table? Do I have to make something special in the create table -statement?
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.