I have a database structured as follows:
users
userid (Primary Key)
username
group
Here is a (probably oversimplified) example that addresses your issue. Note that it is always best to use parameters to prevent injection attacks, especially when verifying users.
CREATE PROCEDURE AddUser
@username varchar(20)
AS
IF NOT EXISTS(SELECT username FROM users WHERE username=@username)
INSERT INTO users(username) VALUES (@username)