SQL for Non-Programmers -- Homework Practice


Please login or register to vote for this query.

(click on this box to dismiss)

Space Exploration

Q&A for spacecraft operators, scientists, engineers, and enthusiasts

WITH PostingHistory AS 
   (SELECT OwnerUserId FROM Posts WHERE PostTypeId IN (1,2)
    AND CreationDate > DATEADD(month, -1, GETUTCDATE())
Commenting AS 
   (SELECT UserId FROM Comments 
    WHERE CreationDate > DATEADD(month, -1, GETUTCDATE())
Editing AS 
   (SELECT UserId FROM PostHistory 
    WHERE PostHistoryTypeId IN (4, 5, 6) 
    AND CreationDate > DATEADD(month, -1, GETUTCDATE())
FROM Users
WHERE Users.Id IN (SELECT OwnerUserId FROM PostingHistory)
OR Users.Id IN (SELECT UserId FROM Commenting)
OR Users.Id IN (SELECT UserId FROM Editing)

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results