Problem 2: The Smallest Unique Positive Integer (100 pts)
Who successfully managed to guess the smallest unique positive integer value? Let's find out!
Write an SQL query to create a table with the columns time
and smallest
which contains the timestamp for each submission that made a unique guess for the smallest unique positive integer - that is, only one person put that number for their guess of the smallest unique integer. Also include their guess in the output.
Hint: Think about what attribute you need to
GROUP BY
. Which groups do we want to keep after this? We can filter this out using aHAVING
clause. If you need a refresher on aggregation, see the Review section.
The submission with the timestamp corresponding to the minimum value of this table is the timestamp of the submission with the smallest unique positive integer!
CREATE TABLE smallest_int_having AS
SELECT "REPLACE THIS LINE WITH YOUR SOLUTION";