This question was tagged sql-server so I will offer a SQL Server answer...
If you had a table with a registered user id and the number, with a unique constraint on those two columns, then if inserting the record succeeds that record is claimed by that user, otherwise it is not available.
CREATE TABLE dbo.UserSelection
(
user_id int not null,
selection int not null,
CONSTRAINT UK_UserSelection__user_id__selection UNIQUE (user_id, selection)
)
There are many ways to tell if the insert failed. One way would be to check if there were errors. Execute some SQL similar to this from your app:
SqlCommand cmd = connection.CreateCommand();
cmd.CommandText = "INSERT INTO dbo.UserSelection(user_id, selection) VALUES (@id, @selection); SELECT @@ERROR;";
cmd.Parameters.AddWithValue("@id", userId);
cmd.Parameters.AddWithValue("@selection", selection);
bool youHaveThatSelection = 0 == (int)cmd.ExecuteScalar();