Stack Exchange Data Explorer Schema

   ERD reverse engineered from information_schema.columns using a Python script and DbSchema


1 Z 1 Z 1 P info_schema_create_tables.sql Move the mouse over tables & columns to read the comments. ReviewTasks Users Posts Tags Flags Closed Votes and Feedback History Fk Fk_ReviewTasks_ReviewTaskTypes ReviewTasks ref ReviewTaskTypes ( ReviewTaskTypeId -> Id ) ReviewTaskTypeId Fk Fk_ReviewTasks_ReviewTaskStates ReviewTasks ref ReviewTaskStates ( ReviewTaskStateId -> Id ) ReviewTaskStateId Fk Fk_ReviewTasks_Posts ReviewTasks ref Posts ( PostId -> Id ) PostId Fk Fk_ReviewTasks_SuggestedEdits ReviewTasks ref SuggestedEdits ( SuggestedEditId -> Id ) SuggestedEditId Fk Fk_ReviewTasks_CompletedByReviewTaskId ReviewTasks ref ReviewTaskResults ( CompletedByReviewTaskId -> Id ) CompletedByReviewTaskId Fk Fk_PostTags_Posts PostTags ref Posts ( PostId -> Id ) PostId Fk Fk_PostTags_Tags PostTags ref Tags ( TagId -> Id ) TagId Fk Fk_Tags_Posts Tags ref Posts ( ExcerptPostId -> Id ) ExcerptPostId Fk Fk_Tags_Posts_001 Tags ref Posts ( WikiPostId -> Id ) WikiPostId Fk Fk_PendingFlags_FlagTypes PendingFlags ref FlagTypes ( FlagTypeId -> Id ) FlagTypeId Fk Fk_PendingFlags_Posts PendingFlags ref Posts ( PostId -> Id ) PostId Fk Fk_PendingFlags_CloseReasonTypes PendingFlags ref CloseReasonTypes ( CloseReasonTypeId -> Id ) CloseReasonTypeId Fk Fk_PendingFlags_CloseAsOffTopicReasonTypes PendingFlags ref CloseAsOffTopicReasonTypes ( CloseAsOffTopicReasonTypeId -> Id ) CloseAsOffTopicReasonTypeId Fk Fk_PendingFlags_Posts_001 PendingFlags ref Posts ( DuplicateOfQuestionId -> Id ) DuplicateOfQuestionId Fk Fk_Badges_Users Badges ref Users ( UserId -> Id ) UserId Fk Fk_PostHistory_PostHistoryTypes PostHistory ref PostHistoryTypes ( PostHistoryTypeId -> Id ) PostHistoryTypeId Fk Fk_PostHistory_Posts PostHistory ref Posts ( PostId -> Id ) PostId Fk Fk_PostHistory_Users PostHistory ref Users ( UserId -> Id ) UserId Fk Fk_SuggestedEditVotes_SuggestedEdits SuggestedEditVotes ref SuggestedEdits ( SuggestedEditId -> Id ) SuggestedEditId Fk Fk_SuggestedEditVotes_Users SuggestedEditVotes ref Users ( UserId -> Id ) UserId Fk Fk_SuggestedEditVotes_VoteTypes SuggestedEditVotes ref VoteTypes ( VoteTypeId -> Id ) VoteTypeId Fk Fk_SuggestedEditVotes_Users_001 SuggestedEditVotes ref Users ( TargetUserId -> Id ) TargetUserId Fk Fk_PostFeedback_Posts PostFeedback ref Posts ( PostId -> Id ) PostId Fk Fk_PostFeedback_VoteTypes PostFeedback ref VoteTypes ( VoteTypeId -> Id ) VoteTypeId Fk Fk_TagSynonyms_Users TagSynonyms ref Users ( OwnerUserId -> Id ) OwnerUserId Fk Fk_TagSynonyms_Users_001 TagSynonyms ref Users ( ApprovedByUserId -> Id ) ApprovedByUserId Fk Fk_TagSynonymsSourceTagName_Tags TagSynonyms ref Tags ( SourceTagName -> TagName ) SourceTagName Fk Fk_TagSynonymsTargetTagName_Tags TagSynonyms ref Tags ( TargetTagName -> TagName ) TargetTagName Fk Fk_Posts_PostTypes Posts ref PostTypes ( PostTypeId -> Id ) PostTypeId Fk Fk_Posts_Users Posts ref Users ( OwnerUserId -> Id ) OwnerUserId Fk Fk_Posts_Users_001 Posts ref Users ( LastEditorUserId -> Id ) LastEditorUserId Fk Fk_Posts_Posts Posts ref Posts ( AcceptedAnswerId -> Id ) AcceptedAnswerId Fk Fk_Posts_Posts_001 Posts ref Posts ( ParentId -> Id ) ParentId Fk Fk_SuggestedEdits_Posts SuggestedEdits ref Posts ( PostId -> Id ) PostId Fk Fk_SuggestedEdits_Users SuggestedEdits ref Users ( OwnerUserId -> Id ) OwnerUserId Fk Fk_Votes_Posts Votes ref Posts ( PostId -> Id ) PostId Fk Fk_Votes_VoteTypes Votes ref VoteTypes ( VoteTypeId -> Id ) VoteTypeId Fk Fk_Votes_Users Votes ref Users ( UserId -> Id ) UserId Fk Fk_PostsWithDeleted_PostTypes PostsWithDeleted ref PostTypes ( PostTypeId -> Id ) PostTypeId Fk Fk_PostsWithDeleted_Users PostsWithDeleted ref Users ( OwnerUserId -> Id ) OwnerUserId Fk Fk_PostsWithDeleted_Users_001 PostsWithDeleted ref Users ( LastEditorUserId -> Id ) LastEditorUserId Fk Fk_PostsWithDeleted_Posts PostsWithDeleted ref Posts ( AcceptedAnswerId -> Id ) AcceptedAnswerId Fk Fk_PostsWithDeleted_Posts_001 PostsWithDeleted ref Posts ( ParentId -> Id ) ParentId Fk Fk_CloseAsOffTopicReasonTypes_Users CloseAsOffTopicReasonTypes ref Users ( CreationModeratorId -> Id ) CreationModeratorId Fk Fk_CloseAsOffTopicReasonTypes_Users_001 CloseAsOffTopicReasonTypes ref Users ( ApprovalModeratorId -> Id ) ApprovalModeratorId Fk Fk_CloseAsOffTopicReasonTypes_Users_002 CloseAsOffTopicReasonTypes ref Users ( DeactivationModeratorId -> Id ) DeactivationModeratorId Fk Fk_PostNotices_Posts PostNotices ref Posts ( PostId -> Id ) PostId Fk Fk_PostNotices_PostNoticeTypes PostNotices ref PostNoticeTypes ( PostNoticeTypeId -> Id ) PostNoticeTypeId Fk Fk_PostNotices_Users PostNotices ref Users ( OwnerUserId -> Id ) OwnerUserId Fk Fk_PostNotices_Users_001 PostNotices ref Users ( DeletionUserId -> Id ) DeletionUserId Fk Fk_Comments_Posts Comments ref Posts ( PostId -> Id ) PostId Fk Fk_Comments_Users Comments ref Users ( UserId -> Id ) UserId Fk Fk_PostLinks_Posts PostLinks ref Posts ( PostId -> Id ) PostId Fk Fk_PostLinks_Posts_001 PostLinks ref Posts ( RelatedPostId -> Id ) RelatedPostId Fk Fk_ReviewRejectionReasons_PostTypes ReviewRejectionReasons ref PostTypes ( PostTypeId -> Id ) PostTypeId Fk Fk_ReviewTaskResults_ReviewTasks ReviewTaskResults ref ReviewTasks ( ReviewTaskId -> Id ) ReviewTaskId Fk Fk_ReviewTaskResults_ReviewTaskResultTypes ReviewTaskResults ref ReviewTaskResultTypes ( ReviewTaskResultTypeId -> Id ) ReviewTaskResultTypeId Fk Fk_ReviewTaskResults_ReviewRejectionReasons ReviewTaskResults ref ReviewRejectionReasons ( RejectionReasonId -> Id ) RejectionReasonId ReviewTasksTable ReviewTasks Primary ( Id ) IdintId * int Referred by ReviewTaskResults ( ReviewTaskId -> Id ) ReviewTaskTypeIdtinyintReviewTaskTypeId * tinyint References ReviewTaskTypes ( ReviewTaskTypeId -> Id ) CreationDatedateCreationDate date DeletionDatedateDeletionDate date ReviewTaskStateIdtinyintReviewTaskStateId * tinyint References ReviewTaskStates ( ReviewTaskStateId -> Id ) PostIdintPostId * int References Posts ( PostId -> Id ) SuggestedEditIdintSuggestedEditId int References SuggestedEdits ( SuggestedEditId -> Id ) CompletedByReviewTaskIdintCompletedByReviewTaskId int References ReviewTaskResults ( CompletedByReviewTaskId -> Id ) PostTagsTable PostTags PostIdintPostId * int References Posts ( PostId -> Id ) TagIdintTagId * int References Tags ( TagId -> Id ) TagsTable Tags Primary ( Id ) IdintId * int Referred by PostTags ( TagId -> Id ) TagNamenvarcharTagName nvarchar Referred by TagSynonyms ( SourceTagName -> TagName ) Referred by TagSynonyms ( TargetTagName -> TagName ) CountintCount * int ExcerptPostIdintExcerptPostId int References Posts ( ExcerptPostId -> Id ) WikiPostIdintWikiPostId int References Posts ( WikiPostId -> Id ) PendingFlagsTable PendingFlags Primary ( Id ) IdintId * int FlagTypeIdtinyintFlagTypeId * tinyint References FlagTypes ( FlagTypeId -> Id ) PostIdintPostId * int References Posts ( PostId -> Id ) CreationDatedateCreationDate date CloseReasonTypeIdtinyintCloseReasonTypeId tinyint References CloseReasonTypes ( CloseReasonTypeId -> Id ) CloseAsOffTopicReasonTypeIdsmallintCloseAsOffTopicReasonTypeId smallint References CloseAsOffTopicReasonTypes ( CloseAsOffTopicReasonTypeId -> Id ) DuplicateOfQuestionIdintDuplicateOfQuestionId int References Posts ( DuplicateOfQuestionId -> Id ) BelongsOnBaseHostAddressnvarcharBelongsOnBaseHostAddress nvarchar BadgesTable Badges Primary ( Id ) IdintId * int UserIdintUserId * int References Users ( UserId -> Id ) NamenvarcharName * nvarchar DatedatetimeDate * datetime ClasstinyintClass * tinyint TagBasedbitTagBased * bit PostHistoryTable PostHistory Primary ( Id ) IdintId * int PostHistoryTypeIdtinyintPostHistoryTypeId * tinyint References PostHistoryTypes ( PostHistoryTypeId -> Id ) PostIdintPostId * int References Posts ( PostId -> Id ) RevisionGUIDuniqueidentifierRevisionGUID * uniqueidentifier CreationDatedatetimeCreationDate * datetime UserIdintUserId int References Users ( UserId -> Id ) UserDisplayNamenvarcharUserDisplayName nvarchar CommentnvarcharComment nvarchar TextnvarcharText nvarchar SuggestedEditVotesTable SuggestedEditVotes Primary ( Id ) IdintId * int SuggestedEditIdintSuggestedEditId * int References SuggestedEdits ( SuggestedEditId -> Id ) UserIdintUserId * int References Users ( UserId -> Id ) VoteTypeIdtinyintVoteTypeId * tinyint References VoteTypes ( VoteTypeId -> Id ) CreationDatedatetimeCreationDate * datetime TargetUserIdintTargetUserId int References Users ( TargetUserId -> Id ) TargetRepChangeintTargetRepChange * int PostFeedbackTable PostFeedback Primary ( Id ) IdintId * int PostIdintPostId * int References Posts ( PostId -> Id ) IsAnonymousbitIsAnonymous bit VoteTypeIdtinyintVoteTypeId * tinyint References VoteTypes ( VoteTypeId -> Id ) CreationDatedatetimeCreationDate * datetime TagSynonymsTable TagSynonyms Primary ( Id ) IdintId * int SourceTagNamenvarcharSourceTagName nvarchar References Tags ( SourceTagName -> TagName ) TargetTagNamenvarcharTargetTagName nvarchar References Tags ( TargetTagName -> TagName ) CreationDatedatetimeCreationDate * datetime OwnerUserIdintOwnerUserId * int References Users ( OwnerUserId -> Id ) AutoRenameCountintAutoRenameCount * int LastAutoRenamedatetimeLastAutoRename datetime ScoreintScore * int ApprovedByUserIdintApprovedByUserId int References Users ( ApprovedByUserId -> Id ) ApprovalDatedatetimeApprovalDate datetime FlagTypesTable FlagTypes Primary ( Id ) IdtinyintId * tinyint Referred by PendingFlags ( FlagTypeId -> Id ) NamenvarcharName * nvarchar DescriptionnvarcharDescription * nvarchar PostHistoryTypesTable PostHistoryTypes Primary ( Id ) IdtinyintId * tinyint Referred by PostHistory ( PostHistoryTypeId -> Id ) NamenvarcharName * nvarchar PostsTable Posts Primary ( Id ) IdintId * int Referred by Comments ( PostId -> Id ) Referred by PendingFlags ( PostId -> Id ) Referred by PendingFlags ( DuplicateOfQuestionId -> Id ) Referred by PostFeedback ( PostId -> Id ) Referred by PostHistory ( PostId -> Id ) Referred by PostLinks ( PostId -> Id ) Referred by PostLinks ( RelatedPostId -> Id ) Referred by PostNotices ( PostId -> Id ) Referred by PostTags ( PostId -> Id ) Referred by Posts ( AcceptedAnswerId -> Id ) Referred by Posts ( ParentId -> Id ) Referred by PostsWithDeleted ( AcceptedAnswerId -> Id ) Referred by PostsWithDeleted ( ParentId -> Id ) Referred by ReviewTasks ( PostId -> Id ) Referred by SuggestedEdits ( PostId -> Id ) Referred by Tags ( ExcerptPostId -> Id ) Referred by Tags ( WikiPostId -> Id ) Referred by Votes ( PostId -> Id ) PostTypeIdtinyintPostTypeId * tinyint References PostTypes ( PostTypeId -> Id ) AcceptedAnswerIdintAcceptedAnswerId int References Posts ( AcceptedAnswerId -> Id ) ParentIdintParentId int References Posts ( ParentId -> Id ) CreationDatedatetimeCreationDate * datetime DeletionDatedatetimeDeletionDate datetime ScoreintScore * int ViewCountintViewCount int BodynvarcharBody nvarchar OwnerUserIdintOwnerUserId int References Users ( OwnerUserId -> Id ) OwnerDisplayNamenvarcharOwnerDisplayName nvarchar LastEditorUserIdintLastEditorUserId int References Users ( LastEditorUserId -> Id ) LastEditorDisplayNamenvarcharLastEditorDisplayName nvarchar LastEditDatedatetimeLastEditDate datetime LastActivityDatedatetimeLastActivityDate datetime TitlenvarcharTitle nvarchar TagsnvarcharTags nvarchar AnswerCountintAnswerCount int CommentCountintCommentCount int FavoriteCountintFavoriteCount int ClosedDatedatetimeClosedDate datetime CommunityOwnedDatedatetimeCommunityOwnedDate datetime PostTypesTable PostTypes Primary ( Id ) IdtinyintId * tinyint Referred by Posts ( PostTypeId -> Id ) Referred by PostsWithDeleted ( PostTypeId -> Id ) Referred by ReviewRejectionReasons ( PostTypeId -> Id ) NamenvarcharName * nvarchar SuggestedEditsTable SuggestedEdits Primary ( Id ) IdintId * int Referred by ReviewTasks ( SuggestedEditId -> Id ) Referred by SuggestedEditVotes ( SuggestedEditId -> Id ) PostIdintPostId * int References Posts ( PostId -> Id ) CreationDatedatetimeCreationDate datetime ApprovalDatedatetimeApprovalDate datetime RejectionDatedatetimeRejectionDate datetime OwnerUserIdintOwnerUserId int References Users ( OwnerUserId -> Id ) CommentnvarcharComment nvarchar TextnvarcharText nvarchar TitlenvarcharTitle nvarchar TagsnvarcharTags nvarchar RevisionGUIDuniqueidentifierRevisionGUID uniqueidentifier VotesTable Votes Primary ( Id ) IdintId * int PostIdintPostId * int References Posts ( PostId -> Id ) VoteTypeIdtinyintVoteTypeId * tinyint References VoteTypes ( VoteTypeId -> Id ) UserIdintUserId int References Users ( UserId -> Id ) CreationDatedatetimeCreationDate datetime BountyAmountintBountyAmount int VoteTypesTable VoteTypes Primary ( Id ) IdtinyintId * tinyint Referred by PostFeedback ( VoteTypeId -> Id ) Referred by SuggestedEditVotes ( VoteTypeId -> Id ) Referred by Votes ( VoteTypeId -> Id ) NamenvarcharName * nvarchar PostsWithDeletedTable PostsWithDeleted Primary ( Id ) IdintId * int PostTypeIdtinyintPostTypeId * tinyint References PostTypes ( PostTypeId -> Id ) AcceptedAnswerIdintAcceptedAnswerId int References Posts ( AcceptedAnswerId -> Id ) ParentIdintParentId int References Posts ( ParentId -> Id ) CreationDatedatetimeCreationDate * datetime DeletionDatedatetimeDeletionDate datetime ScoreintScore * int ViewCountintViewCount int BodynvarcharBody nvarchar OwnerUserIdintOwnerUserId int References Users ( OwnerUserId -> Id ) OwnerDisplayNamenvarcharOwnerDisplayName nvarchar LastEditorUserIdintLastEditorUserId int References Users ( LastEditorUserId -> Id ) LastEditorDisplayNamenvarcharLastEditorDisplayName nvarchar LastEditDatedatetimeLastEditDate datetime LastActivityDatedatetimeLastActivityDate datetime TitlenvarcharTitle nvarchar TagsnvarcharTags nvarchar AnswerCountintAnswerCount int CommentCountintCommentCount int FavoriteCountintFavoriteCount int ClosedDatedatetimeClosedDate datetime CommunityOwnedDatedatetimeCommunityOwnedDate datetime CloseAsOffTopicReasonTypesTable CloseAsOffTopicReasonTypes Primary ( Id ) IdsmallintId * smallint Referred by PendingFlags ( CloseAsOffTopicReasonTypeId -> Id ) IsUniversalbitIsUniversal * bit MarkdownMininvarcharMarkdownMini * nvarchar CreationDatedatetimeCreationDate * datetime CreationModeratorIdintCreationModeratorId int References Users ( CreationModeratorId -> Id ) ApprovalDatedatetimeApprovalDate datetime ApprovalModeratorIdintApprovalModeratorId int References Users ( ApprovalModeratorId -> Id ) DeactivationDatedatetimeDeactivationDate datetime DeactivationModeratorIdintDeactivationModeratorId int References Users ( DeactivationModeratorId -> Id ) CloseReasonTypesTable CloseReasonTypes Primary ( Id ) IdtinyintId * tinyint Referred by PendingFlags ( CloseReasonTypeId -> Id ) NamenvarcharName * nvarchar DescriptionnvarcharDescription nvarchar PostNoticesTable PostNotices Primary ( Id ) IdintId * int PostIdintPostId * int References Posts ( PostId -> Id ) PostNoticeTypeIdintPostNoticeTypeId int References PostNoticeTypes ( PostNoticeTypeId -> Id ) CreationDatedatetimeCreationDate * datetime DeletionDatedatetimeDeletionDate datetime ExpiryDatedatetimeExpiryDate datetime BodynvarcharBody nvarchar OwnerUserIdintOwnerUserId int References Users ( OwnerUserId -> Id ) DeletionUserIdintDeletionUserId int References Users ( DeletionUserId -> Id ) PostNoticeTypesTable PostNoticeTypes Primary ( Id ) IdintId * int Referred by PostNotices ( PostNoticeTypeId -> Id ) ClassIdtinyintClassId * tinyint NamenvarcharName nvarchar BodynvarcharBody nvarchar IsHiddenbitIsHidden * bit PredefinedbitPredefined * bit PostNoticeDurationIdintPostNoticeDurationId * int CommentsTable Comments Primary ( Id ) IdintId * int PostIdintPostId * int References Posts ( PostId -> Id ) ScoreintScore * int TextnvarcharText * nvarchar CreationDatedatetimeCreationDate * datetime UserDisplayNamenvarcharUserDisplayName nvarchar UserIdintUserId int References Users ( UserId -> Id ) PostLinksTable PostLinks Primary ( Id ) IdintId * int CreationDatedatetimeCreationDate * datetime PostIdintPostId * int References Posts ( PostId -> Id ) RelatedPostIdintRelatedPostId * int References Posts ( RelatedPostId -> Id ) LinkTypeIdtinyintLinkTypeId * tinyint ReviewRejectionReasonsTable ReviewRejectionReasons Primary ( Id ) IdtinyintId * tinyint Referred by ReviewTaskResults ( RejectionReasonId -> Id ) NamenvarcharName * nvarchar DescriptionnvarcharDescription * nvarchar PostTypeIdtinyintPostTypeId tinyint References PostTypes ( PostTypeId -> Id ) ReviewTaskTypesTable ReviewTaskTypes Primary ( Id ) IdtinyintId * tinyint Referred by ReviewTasks ( ReviewTaskTypeId -> Id ) NamenvarcharName * nvarchar DescriptionnvarcharDescription * nvarchar ReviewTaskStatesTable ReviewTaskStates Primary ( Id ) IdtinyintId * tinyint Referred by ReviewTasks ( ReviewTaskStateId -> Id ) NamenvarcharName * nvarchar DescriptionnvarcharDescription * nvarchar ReviewTaskResultsTable ReviewTaskResults Primary ( Id ) IdintId * int Referred by ReviewTasks ( CompletedByReviewTaskId -> Id ) ReviewTaskIdintReviewTaskId * int References ReviewTasks ( ReviewTaskId -> Id ) ReviewTaskResultTypeIdtinyintReviewTaskResultTypeId * tinyint References ReviewTaskResultTypes ( ReviewTaskResultTypeId -> Id ) CreationDatedateCreationDate date RejectionReasonIdtinyintRejectionReasonId tinyint References ReviewRejectionReasons ( RejectionReasonId -> Id ) CommentnvarcharComment nvarchar ReviewTaskResultTypesTable ReviewTaskResultTypes Primary ( Id ) IdtinyintId * tinyint Referred by ReviewTaskResults ( ReviewTaskResultTypeId -> Id ) NamenvarcharName * nvarchar DescriptionnvarcharDescription * nvarchar UsersTable Users Primary ( Id ) IdintId * int Referred by Badges ( UserId -> Id ) Referred by CloseAsOffTopicReasonTypes ( CreationModeratorId -> Id ) Referred by CloseAsOffTopicReasonTypes ( ApprovalModeratorId -> Id ) Referred by CloseAsOffTopicReasonTypes ( DeactivationModeratorId -> Id ) Referred by Comments ( UserId -> Id ) Referred by PostHistory ( UserId -> Id ) Referred by PostNotices ( OwnerUserId -> Id ) Referred by PostNotices ( DeletionUserId -> Id ) Referred by Posts ( OwnerUserId -> Id ) Referred by Posts ( LastEditorUserId -> Id ) Referred by PostsWithDeleted ( OwnerUserId -> Id ) Referred by PostsWithDeleted ( LastEditorUserId -> Id ) Referred by SuggestedEditVotes ( UserId -> Id ) Referred by SuggestedEditVotes ( TargetUserId -> Id ) Referred by SuggestedEdits ( OwnerUserId -> Id ) Referred by TagSynonyms ( OwnerUserId -> Id ) Referred by TagSynonyms ( ApprovedByUserId -> Id ) Referred by Votes ( UserId -> Id ) ReputationintReputation * int CreationDatedatetimeCreationDate * datetime DisplayNamenvarcharDisplayName nvarchar LastAccessDatedatetimeLastAccessDate * datetime WebsiteUrlnvarcharWebsiteUrl nvarchar LocationnvarcharLocation nvarchar AboutMenvarcharAboutMe nvarchar ViewsintViews * int UpVotesintUpVotes * int DownVotesintDownVotes * int ProfileImageUrlnvarcharProfileImageUrl nvarchar EmailHashvarchar(32)EmailHash varchar(32) AccountIdintAccountId int




Table Badges
IndexesField NameData TypeDescription
* Id int
* UserId int
* Name nvarchar
* Date datetime
* Class tinyint
* TagBased bit
Indexes
Primary ON Id
Foreign Keys
Fk_Badges_Users ( UserId ) ref Users (Id)


Table CloseAsOffTopicReasonTypes
IndexesField NameData TypeDescription
* Id smallint
* IsUniversal bit
* MarkdownMini nvarchar
* CreationDate datetime
CreationModeratorId int
  ApprovalDate datetime
ApprovalModeratorId int
  DeactivationDate datetime
DeactivationModeratorId int
Indexes
Primary ON Id
Foreign Keys
Fk_CloseAsOffTopicReasonTypes_Users ( CreationModeratorId ) ref Users (Id)
Fk_CloseAsOffTopicReasonTypes_Users_001 ( ApprovalModeratorId ) ref Users (Id)
Fk_CloseAsOffTopicReasonTypes_Users_002 ( DeactivationModeratorId ) ref Users (Id)


Table CloseReasonTypes
IndexesField NameData TypeDescription
* Id tinyint
* Name nvarchar
  Description nvarchar
Indexes
Primary ON Id


Table Comments
IndexesField NameData TypeDescription
* Id int
* PostId int
* Score int
* Text nvarchar
* CreationDate datetime
  UserDisplayName nvarchar
UserId int
Indexes
Primary ON Id
Foreign Keys
Fk_Comments_Posts ( PostId ) ref Posts (Id)
Fk_Comments_Users ( UserId ) ref Users (Id)


Table FlagTypes
IndexesField NameData TypeDescription
* Id tinyint
* Name nvarchar
* Description nvarchar
Indexes
Primary ON Id


Table PendingFlags
IndexesField NameData TypeDescription
* Id int
* FlagTypeId tinyint
* PostId int
  CreationDate date
CloseReasonTypeId tinyint
CloseAsOffTopicReasonTypeId smallint
DuplicateOfQuestionId int
  BelongsOnBaseHostAddress nvarchar
Indexes
Primary ON Id
Foreign Keys
Fk_PendingFlags_FlagTypes ( FlagTypeId ) ref FlagTypes (Id)
Fk_PendingFlags_Posts ( PostId ) ref Posts (Id)
Fk_PendingFlags_CloseReasonTypes ( CloseReasonTypeId ) ref CloseReasonTypes (Id)
Fk_PendingFlags_CloseAsOffTopicReasonTypes ( CloseAsOffTopicReasonTypeId ) ref CloseAsOffTopicReasonTypes (Id)
Fk_PendingFlags_Posts_001 ( DuplicateOfQuestionId ) ref Posts (Id)


Table PostFeedback
IndexesField NameData TypeDescription
* Id int
* PostId int
  IsAnonymous bit
* VoteTypeId tinyint
* CreationDate datetime
Indexes
Primary ON Id
Foreign Keys
Fk_PostFeedback_Posts ( PostId ) ref Posts (Id)
Fk_PostFeedback_VoteTypes ( VoteTypeId ) ref VoteTypes (Id)


Table PostHistory
IndexesField NameData TypeDescription
* Id int
* PostHistoryTypeId tinyint
* PostId int
* RevisionGUID uniqueidentifier
* CreationDate datetime
UserId int
  UserDisplayName nvarchar
  Comment nvarchar
  Text nvarchar
Indexes
Primary ON Id
Foreign Keys
Fk_PostHistory_PostHistoryTypes ( PostHistoryTypeId ) ref PostHistoryTypes (Id)
Fk_PostHistory_Posts ( PostId ) ref Posts (Id)
Fk_PostHistory_Users ( UserId ) ref Users (Id)


Table PostHistoryTypes
IndexesField NameData TypeDescription
* Id tinyint
* Name nvarchar
Indexes
Primary ON Id


Table PostLinks
IndexesField NameData TypeDescription
* Id int
* CreationDate datetime
* PostId int
* RelatedPostId int
* LinkTypeId tinyint
Indexes
Primary ON Id
Foreign Keys
Fk_PostLinks_Posts ( PostId ) ref Posts (Id)
Fk_PostLinks_Posts_001 ( RelatedPostId ) ref Posts (Id)


Table PostNoticeTypes
IndexesField NameData TypeDescription
* Id int
* ClassId tinyint
  Name nvarchar
  Body nvarchar
* IsHidden bit
* Predefined bit
* PostNoticeDurationId int
Indexes
Primary ON Id


Table PostNotices
IndexesField NameData TypeDescription
* Id int
* PostId int
PostNoticeTypeId int
* CreationDate datetime
  DeletionDate datetime
  ExpiryDate datetime
  Body nvarchar
OwnerUserId int
DeletionUserId int
Indexes
Primary ON Id
Foreign Keys
Fk_PostNotices_Posts ( PostId ) ref Posts (Id)
Fk_PostNotices_PostNoticeTypes ( PostNoticeTypeId ) ref PostNoticeTypes (Id)
Fk_PostNotices_Users ( OwnerUserId ) ref Users (Id)
Fk_PostNotices_Users_001 ( DeletionUserId ) ref Users (Id)


Table PostTags
IndexesField NameData TypeDescription
* PostId int
* TagId int
Foreign Keys
Fk_PostTags_Posts ( PostId ) ref Posts (Id)
Fk_PostTags_Tags ( TagId ) ref Tags (Id)


Table PostTypes
IndexesField NameData TypeDescription
* Id tinyint
* Name nvarchar
Indexes
Primary ON Id


Table Posts
IndexesField NameData TypeDescription
* Id int
* PostTypeId tinyint
AcceptedAnswerId int
ParentId int
* CreationDate datetime
  DeletionDate datetime
* Score int
  ViewCount int
  Body nvarchar
OwnerUserId int
  OwnerDisplayName nvarchar
LastEditorUserId int
  LastEditorDisplayName nvarchar
  LastEditDate datetime
  LastActivityDate datetime
  Title nvarchar
  Tags nvarchar
  AnswerCount int
  CommentCount int
  FavoriteCount int
  ClosedDate datetime
  CommunityOwnedDate datetime
Indexes
Primary ON Id
Foreign Keys
Fk_Posts_PostTypes ( PostTypeId ) ref PostTypes (Id)
Fk_Posts_Users ( OwnerUserId ) ref Users (Id)
Fk_Posts_Users_001 ( LastEditorUserId ) ref Users (Id)
Fk_Posts_Posts ( AcceptedAnswerId ) ref Posts (Id)
Fk_Posts_Posts_001 ( ParentId ) ref Posts (Id)


Table PostsWithDeleted
IndexesField NameData TypeDescription
* Id int
* PostTypeId tinyint
AcceptedAnswerId int
ParentId int
* CreationDate datetime
  DeletionDate datetime
* Score int
  ViewCount int
  Body nvarchar
OwnerUserId int
  OwnerDisplayName nvarchar
LastEditorUserId int
  LastEditorDisplayName nvarchar
  LastEditDate datetime
  LastActivityDate datetime
  Title nvarchar
  Tags nvarchar
  AnswerCount int
  CommentCount int
  FavoriteCount int
  ClosedDate datetime
  CommunityOwnedDate datetime
Indexes
Primary ON Id
Foreign Keys
Fk_PostsWithDeleted_PostTypes ( PostTypeId ) ref PostTypes (Id)
Fk_PostsWithDeleted_Users ( OwnerUserId ) ref Users (Id)
Fk_PostsWithDeleted_Users_001 ( LastEditorUserId ) ref Users (Id)
Fk_PostsWithDeleted_Posts ( AcceptedAnswerId ) ref Posts (Id)
Fk_PostsWithDeleted_Posts_001 ( ParentId ) ref Posts (Id)


Table ReviewRejectionReasons
IndexesField NameData TypeDescription
* Id tinyint
* Name nvarchar
* Description nvarchar
PostTypeId tinyint
Indexes
Primary ON Id
Foreign Keys
Fk_ReviewRejectionReasons_PostTypes ( PostTypeId ) ref PostTypes (Id)


Table ReviewTaskResultTypes
IndexesField NameData TypeDescription
* Id tinyint
* Name nvarchar
* Description nvarchar
Indexes
Primary ON Id


Table ReviewTaskResults
IndexesField NameData TypeDescription
* Id int
* ReviewTaskId int
* ReviewTaskResultTypeId tinyint
  CreationDate date
RejectionReasonId tinyint
  Comment nvarchar
Indexes
Primary ON Id
Foreign Keys
Fk_ReviewTaskResults_ReviewTasks ( ReviewTaskId ) ref ReviewTasks (Id)
Fk_ReviewTaskResults_ReviewTaskResultTypes ( ReviewTaskResultTypeId ) ref ReviewTaskResultTypes (Id)
Fk_ReviewTaskResults_ReviewRejectionReasons ( RejectionReasonId ) ref ReviewRejectionReasons (Id)


Table ReviewTaskStates
IndexesField NameData TypeDescription
* Id tinyint
* Name nvarchar
* Description nvarchar
Indexes
Primary ON Id


Table ReviewTaskTypes
IndexesField NameData TypeDescription
* Id tinyint
* Name nvarchar
* Description nvarchar
Indexes
Primary ON Id


Table ReviewTasks
IndexesField NameData TypeDescription
* Id int
* ReviewTaskTypeId tinyint
  CreationDate date
  DeletionDate date
* ReviewTaskStateId tinyint
* PostId int
SuggestedEditId int
CompletedByReviewTaskId int
Indexes
Primary ON Id
Foreign Keys
Fk_ReviewTasks_ReviewTaskTypes ( ReviewTaskTypeId ) ref ReviewTaskTypes (Id)
Fk_ReviewTasks_ReviewTaskStates ( ReviewTaskStateId ) ref ReviewTaskStates (Id)
Fk_ReviewTasks_Posts ( PostId ) ref Posts (Id)
Fk_ReviewTasks_SuggestedEdits ( SuggestedEditId ) ref SuggestedEdits (Id)
Fk_ReviewTasks_CompletedByReviewTaskId ( CompletedByReviewTaskId ) ref ReviewTaskResults (Id)


Table SuggestedEditVotes
IndexesField NameData TypeDescription
* Id int
* SuggestedEditId int
* UserId int
* VoteTypeId tinyint
* CreationDate datetime
TargetUserId int
* TargetRepChange int
Indexes
Primary ON Id
Foreign Keys
Fk_SuggestedEditVotes_SuggestedEdits ( SuggestedEditId ) ref SuggestedEdits (Id)
Fk_SuggestedEditVotes_Users ( UserId ) ref Users (Id)
Fk_SuggestedEditVotes_VoteTypes ( VoteTypeId ) ref VoteTypes (Id)
Fk_SuggestedEditVotes_Users_001 ( TargetUserId ) ref Users (Id)


Table SuggestedEdits
IndexesField NameData TypeDescription
* Id int
* PostId int
  CreationDate datetime
  ApprovalDate datetime
  RejectionDate datetime
OwnerUserId int
  Comment nvarchar
  Text nvarchar
  Title nvarchar
  Tags nvarchar
  RevisionGUID uniqueidentifier
Indexes
Primary ON Id
Foreign Keys
Fk_SuggestedEdits_Posts ( PostId ) ref Posts (Id)
Fk_SuggestedEdits_Users ( OwnerUserId ) ref Users (Id)


Table TagSynonyms
IndexesField NameData TypeDescription
* Id int
SourceTagName nvarchar
TargetTagName nvarchar
* CreationDate datetime
* OwnerUserId int
* AutoRenameCount int
  LastAutoRename datetime
* Score int
ApprovedByUserId int
  ApprovalDate datetime
Indexes
Primary ON Id
Foreign Keys
Fk_TagSynonyms_Users ( OwnerUserId ) ref Users (Id)
Fk_TagSynonyms_Users_001 ( ApprovedByUserId ) ref Users (Id)
Fk_TagSynonymsSourceTagName_Tags ( SourceTagName ) ref Tags (TagName)
Fk_TagSynonymsTargetTagName_Tags ( TargetTagName ) ref Tags (TagName)


Table Tags
IndexesField NameData TypeDescription
* Id int
TagName nvarchar
* Count int
ExcerptPostId int
WikiPostId int
Indexes
Primary ON Id
Foreign Keys
Fk_Tags_Posts ( ExcerptPostId ) ref Posts (Id)
Fk_Tags_Posts_001 ( WikiPostId ) ref Posts (Id)


Table Users
IndexesField NameData TypeDescription
* Id int
* Reputation int
* CreationDate datetime
  DisplayName nvarchar
* LastAccessDate datetime
  WebsiteUrl nvarchar
  Location nvarchar
  AboutMe nvarchar
* Views int
* UpVotes int
* DownVotes int
  ProfileImageUrl nvarchar
  EmailHash varchar( 32 )
  AccountId int
Indexes
Primary ON Id


Table VoteTypes
IndexesField NameData TypeDescription
* Id tinyint
* Name nvarchar
Indexes
Primary ON Id


Table Votes
IndexesField NameData TypeDescription
* Id int
* PostId int
* VoteTypeId tinyint
UserId int
  CreationDate datetime
  BountyAmount int
Indexes
Primary ON Id
Foreign Keys
Fk_Votes_Posts ( PostId ) ref Posts (Id)
Fk_Votes_VoteTypes ( VoteTypeId ) ref VoteTypes (Id)
Fk_Votes_Users ( UserId ) ref Users (Id)