HW1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Skeptics

Q&A for scientific skepticism

/*

SELECT
COUNT(DISTINCT Id) AS count_posts, 
MIN(CreationDate) AS min_date, 
MAX(CreationDate) AS max_date, 
AVG(Score) AS avg_score
FROM Posts;

*/

/*
SELECT 
CONCAT(DATEPART(year, CreationDate), '-', DATEPART(month, CreationDate))
AS 'year-month',
COUNT(DISTINCT Id) AS count_posts
FROM Posts
GROUP BY DATEPART(year, CreationDate), DATEPART(month, CreationDate)
ORDER BY DATEPART(year, CreationDate), DATEPART(month, CreationDate)
*/

/*
SELECT 
CONCAT(DATEPART(year, CreationDate), '-', DATEPART(month, CreationDate))
AS 'year-month',
COUNT(DISTINCT Id) AS cnt,
PostTypeID AS posttypeid
FROM Posts
GROUP BY DATEPART(year, CreationDate), DATEPART(month, CreationDate), PostTypeID
ORDER BY cnt DESC, DATEPART(year, CreationDate), DATEPART(month, CreationDate)
*/
/*
SELECT
Name AS name,
COUNT(UserId) AS cnt
FROM Badges
GROUP BY name
HAVING COUNT(UserId)>=20
ORDER BY cnt DESC
*/

SELECT
DISTINCT Id AS id, 
DisplayName AS displayname, 
Location AS location 
FROM Users
WHERE (Location LIKE '%New York%' OR Location LIKE '%NY%')

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results