In class practice Cynthia


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- How many users didn’t complete their personal information? only consider website url and location --

/*-- How many users didn’t post any questions in year2015.(hint: use PostType table to check which post types is question)--
select count(distinct(OwnerUserId))
from Posts
inner join PostTypes
on PostTypes.Id = Posts.PostTypeId
where PostTypeId <> 1 and Year(CreationDate) = 2015

/*-- How many post titles related to ‘sports’ without any accepted answer? -- 
select count(Id)
from Posts
where Title like '% sport%' and AcceptedAnswerId is NULL

/*-- The user who created the most viewed posts in year 2023. What kind of badges does he/she own? --
select top 10 Class
from Badges
right join Posts
on Badges.UserId = Posts.OwnerUserId
where year(Posts.CreationDate) = 2013
Order by ViewCount desc

--How many posts are voted as spam?--
select *
from VoteTypes

select count(Posts.Id)
from Posts
left join Votes
on Votes.PostId = Posts.Id
where VoteTypeId = 12

Enter Parameters

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