Why am I not Socratic already? Good question days stunted by bad questions. Have you ever found yourself wondering:

'Hey! I ask plenty of good questions! Why don't I have my (|first|second|[0-9]*th) socratic badge already?'

Well, it must be those bad questions. If you ask them, your good questions that day won't count; and unfortunately, you're often inspired to ask both good and bad questions on the same day.

With this query you'll be able to grit your teeth and curse your impetuousness when you see how many good question days you've wasted this way. And there's just one level of inner joining, to boot!

Caveat: This does not take deleted posts into account, so its results can be a bit off, i.e. don't expect your next Socratic badge exactly when your 'actual' value hits the next multiple of 100.
CREATE TABLE PostsWithDeleted (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE PostTypes (
    Id number,
    Name text
)

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

CREATE TABLE Posts (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE Comments (
    Id number,
    PostId number,
    Score number,
    Text text,
    CreationDate time,
    UserDisplayName text,
    UserId number,
    ContentLicense text
)

CREATE TABLE Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId number
)

CREATE TABLE PostHistory (
    Id number,
    PostHistoryTypeId number,
    PostId number,
    RevisionGUID other,
    CreationDate time,
    UserId number,
    UserDisplayName text,
    Comment text,
    Text text,
    ContentLicense text
)

CREATE TABLE ReviewTaskStates (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostLinks (
    Id number,
    CreationDate time,
    PostId number,
    RelatedPostId number,
    LinkTypeId number
)

CREATE TABLE Badges (
    Id number,
    UserId number,
    Name text,
    Date time,
    Class number,
    TagBased boolean
)

CREATE TABLE SuggestedEdits (
    Id number,
    PostId number,
    CreationDate time,
    ApprovalDate time,
    RejectionDate time,
    OwnerUserId number,
    Comment text,
    Text text,
    Title text,
    Tags text,
    RevisionGUID other
)

CREATE TABLE Users (
    Id number,
    Reputation number,
    CreationDate time,
    DisplayName text,
    LastAccessDate time,
    WebsiteUrl text,
    Location text,
    AboutMe text,
    Views number,
    UpVotes number,
    DownVotes number,
    ProfileImageUrl text,
    EmailHash text,
    AccountId number
)

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

CREATE TABLE PendingFlags (
    Id number,
    FlagTypeId number,
    PostId number,
    CreationDate time,
    CloseReasonTypeId number,
    CloseAsOffTopicReasonTypeId number,
    DuplicateOfQuestionId number,
    BelongsOnBaseHostAddress text
)

CREATE TABLE TagSynonyms (
    Id number,
    SourceTagName text,
    TargetTagName text,
    CreationDate time,
    OwnerUserId number,
    AutoRenameCount number,
    LastAutoRename time,
    Score number,
    ApprovedByUserId number,
    ApprovalDate time
)

CREATE TABLE PostFeedback (
    Id number,
    PostId number,
    IsAnonymous boolean,
    VoteTypeId number,
    CreationDate time
)

CREATE TABLE FlagTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE SuggestedEditVotes (
    Id number,
    SuggestedEditId number,
    UserId number,
    VoteTypeId number,
    CreationDate time,
    TargetUserId number,
    TargetRepChange number
)

CREATE TABLE CloseReasonTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE ReviewRejectionReasons (
    Id number,
    Name text,
    Description text,
    PostTypeId number
)

CREATE TABLE PostNoticeTypes (
    Id number,
    ClassId number,
    Name text,
    Body text,
    IsHidden boolean,
    Predefined boolean,
    PostNoticeDurationId number
)

CREATE TABLE Votes (
    Id number,
    PostId number,
    VoteTypeId number,
    UserId number,
    CreationDate time,
    BountyAmount number
)

CREATE TABLE ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment text
)

CREATE TABLE ReviewTaskTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostNotices (
    Id number,
    PostId number,
    PostNoticeTypeId number,
    CreationDate time,
    DeletionDate time,
    ExpiryDate time,
    Body text,
    OwnerUserId number,
    DeletionUserId number
)

CREATE TABLE CloseAsOffTopicReasonTypes (
    Id number,
    IsUniversal boolean,
    InputTitle text,
    MarkdownInputGuidance text,
    MarkdownPostOwnerGuidance text,
    MarkdownPrivilegedUserGuidance text,
    MarkdownConcensusDescription text,
    CreationDate time,
    CreationModeratorId number,
    ApprovalDate time,
    ApprovalModeratorId number,
    DeactivationDate time,
    DeactivationModeratorId number
)

CREATE TABLE ReviewTasks (
    Id number,
    ReviewTaskTypeId number,
    CreationDate time,
    DeletionDate time,
    ReviewTaskStateId number,
    PostId number,
    SuggestedEditId number,
    CompletedByReviewTaskId number
)

CREATE TABLE ReviewTaskResultTypes (
    Id number,
    Name text,
    Description text
)
SELECT SUM(CASE WHEN up > 0 THEN 1 ELSE 0 END) AS potential, SUM(CASE WHEN up > 0 AND down > 0 THEN 1 ELSE 0 END) AS stuntend, SUM(CASE WHEN up > 0 AND down = 0 THEN 1 ELSE 0 END) AS actual FROM (SELECT MAX(CASE WHEN Score > 0 THEN 1 ELSE 0 END) AS up, MAX(CASE WHEN Score < 1 THEN 1 ELSE 0 END) AS down FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 1 GROUP BY CAST(TIME_TO_STR(CreationDate, '%Y/%m/%d') AS TEXT(10))) AS question_days
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Why am I not Socratic already? Good question days stunted by bad questions. Have you ever found yourself wondering:

'Hey! I ask plenty of good questions! Why don't I have my (|first|second|[0-9]*th) socratic badge already?'

Well, it must be those bad questions. If you ask them, your good questions that day won't count; and unfortunately, you're often inspired to ask both good and bad questions on the same day.

With this query you'll be able to grit your teeth and curse your impetuousness when you see how many good question days you've wasted this way. And there's just one level of inner joining, to boot!

Caveat: This does not take deleted posts into account, so its results can be a bit off, i.e. don't expect your next Socratic badge exactly when your 'actual' value hits the next multiple of 100. ### Input: CREATE TABLE PostsWithDeleted (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE PostTypes (
    Id number,
    Name text
)

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

CREATE TABLE Posts (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE Comments (
    Id number,
    PostId number,
    Score number,
    Text text,
    CreationDate time,
    UserDisplayName text,
    UserId number,
    ContentLicense text
)

CREATE TABLE Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId number
)

CREATE TABLE PostHistory (
    Id number,
    PostHistoryTypeId number,
    PostId number,
    RevisionGUID other,
    CreationDate time,
    UserId number,
    UserDisplayName text,
    Comment text,
    Text text,
    ContentLicense text
)

CREATE TABLE ReviewTaskStates (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostLinks (
    Id number,
    CreationDate time,
    PostId number,
    RelatedPostId number,
    LinkTypeId number
)

CREATE TABLE Badges (
    Id number,
    UserId number,
    Name text,
    Date time,
    Class number,
    TagBased boolean
)

CREATE TABLE SuggestedEdits (
    Id number,
    PostId number,
    CreationDate time,
    ApprovalDate time,
    RejectionDate time,
    OwnerUserId number,
    Comment text,
    Text text,
    Title text,
    Tags text,
    RevisionGUID other
)

CREATE TABLE Users (
    Id number,
    Reputation number,
    CreationDate time,
    DisplayName text,
    LastAccessDate time,
    WebsiteUrl text,
    Location text,
    AboutMe text,
    Views number,
    UpVotes number,
    DownVotes number,
    ProfileImageUrl text,
    EmailHash text,
    AccountId number
)

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

CREATE TABLE PendingFlags (
    Id number,
    FlagTypeId number,
    PostId number,
    CreationDate time,
    CloseReasonTypeId number,
    CloseAsOffTopicReasonTypeId number,
    DuplicateOfQuestionId number,
    BelongsOnBaseHostAddress text
)

CREATE TABLE TagSynonyms (
    Id number,
    SourceTagName text,
    TargetTagName text,
    CreationDate time,
    OwnerUserId number,
    AutoRenameCount number,
    LastAutoRename time,
    Score number,
    ApprovedByUserId number,
    ApprovalDate time
)

CREATE TABLE PostFeedback (
    Id number,
    PostId number,
    IsAnonymous boolean,
    VoteTypeId number,
    CreationDate time
)

CREATE TABLE FlagTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE SuggestedEditVotes (
    Id number,
    SuggestedEditId number,
    UserId number,
    VoteTypeId number,
    CreationDate time,
    TargetUserId number,
    TargetRepChange number
)

CREATE TABLE CloseReasonTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE ReviewRejectionReasons (
    Id number,
    Name text,
    Description text,
    PostTypeId number
)

CREATE TABLE PostNoticeTypes (
    Id number,
    ClassId number,
    Name text,
    Body text,
    IsHidden boolean,
    Predefined boolean,
    PostNoticeDurationId number
)

CREATE TABLE Votes (
    Id number,
    PostId number,
    VoteTypeId number,
    UserId number,
    CreationDate time,
    BountyAmount number
)

CREATE TABLE ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment text
)

CREATE TABLE ReviewTaskTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostNotices (
    Id number,
    PostId number,
    PostNoticeTypeId number,
    CreationDate time,
    DeletionDate time,
    ExpiryDate time,
    Body text,
    OwnerUserId number,
    DeletionUserId number
)

CREATE TABLE CloseAsOffTopicReasonTypes (
    Id number,
    IsUniversal boolean,
    InputTitle text,
    MarkdownInputGuidance text,
    MarkdownPostOwnerGuidance text,
    MarkdownPrivilegedUserGuidance text,
    MarkdownConcensusDescription text,
    CreationDate time,
    CreationModeratorId number,
    ApprovalDate time,
    ApprovalModeratorId number,
    DeactivationDate time,
    DeactivationModeratorId number
)

CREATE TABLE ReviewTasks (
    Id number,
    ReviewTaskTypeId number,
    CreationDate time,
    DeletionDate time,
    ReviewTaskStateId number,
    PostId number,
    SuggestedEditId number,
    CompletedByReviewTaskId number
)

CREATE TABLE ReviewTaskResultTypes (
    Id number,
    Name text,
    Description text
) ### Response: SELECT SUM(CASE WHEN up > 0 THEN 1 ELSE 0 END) AS potential, SUM(CASE WHEN up > 0 AND down > 0 THEN 1 ELSE 0 END) AS stuntend, SUM(CASE WHEN up > 0 AND down = 0 THEN 1 ELSE 0 END) AS actual FROM (SELECT MAX(CASE WHEN Score > 0 THEN 1 ELSE 0 END) AS up, MAX(CASE WHEN Score < 1 THEN 1 ELSE 0 END) AS down FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 1 GROUP BY CAST(TIME_TO_STR(CreationDate, '%Y/%m/%d') AS TEXT(10))) AS question_days