RA Practice

basic RA DB scheme

How many users have less than 1000 points?

SELECT COUNT(*)
FROM UserAccounts
WHERE RAPoints < 1000;

How many users don't log in for more than 2 years?

SELECT COUNT(*)
FROM UserAccounts
WHERE LastLogin < ??????(timestamp)

How many users have created at least one achievement?

SELECT COUNT(DISTINCT Author)
FROM Achievements;

How many users didn't create any achievement?

???

How many users have less than 1000 points AND didn't login for 2 years AND didn't create any achievement?

SELECT COUNT(*)
FROM UserAccounts
WHERE
  RAPoints < 1000
  AND LastLogin < ??????(timestamp)
  AND ?????;

Which users have less than 1000 points AND didn't login for 2 years AND didn't create any achievement?

SELECT User
FROM UserAccounts
WHERE
  RAPoints < 1000
  AND LastLogin < ??????(timestamp)
  AND ?????;

How many points the user USERNAME had in the date X?

???

NOTE: rescores won't allow it to be accurate.