You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I loaded Yelp dataset into MySQL and I inferred the schema from it.
According to my understanding of the schema, the table "friend" should be a join table joining a user to another friend (user).
So I expected to have two foreign keys one starting from 'friend.user_id' and pointing to 'user.id' and the second one starting from 'friend.friend_id' and pointing to 'user.id' as well.
CONSTRAINT`fk_friends_user1`FOREIGN KEY (`user_id`) REFERENCES`user` (`id`) ON DELETE NO ACTION ONUPDATE NO ACTION,
CONSTRAINT`fk_friends_user2`FOREIGN KEY (`friend_id`) REFERENCES`user` (`id`) ON DELETE NO ACTION ONUPDATE NO ACTION
Does this make sense?
Thanks a lot.
The text was updated successfully, but these errors were encountered:
Hi, I loaded Yelp dataset into MySQL and I inferred the schema from it.
According to my understanding of the schema, the table "friend" should be a join table joining a user to another friend (user).
So I expected to have two foreign keys one starting from 'friend.user_id' and pointing to 'user.id' and the second one starting from 'friend.friend_id' and pointing to 'user.id' as well.
Does this make sense?
Thanks a lot.
The text was updated successfully, but these errors were encountered: