Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在设计一个帐户持有人有“朋友”的应用程序。我将如何将这些朋友与原始帐户持有人联系起来?一个高效的 SQL 表会是这样的:
AccountHolderID (varChar 20) FriendsID (nText)
我们实现了类似的东西——使用一张桌子来容纳朋友......我们的分解很简单,就像一张朋友桌......
AccountHolderId( type) FriendAccountHolderId ( type) Created(datetime) // useful for tracking when the friend was added
两个 Id 字段都链接回 Accounts/Users 表。