April 2017
Beginner to intermediate
360 pages
9h 35m
English
Our first instinct might simply be to check the users table to make sure there isn't already a row with the requested username in the table. To keep things concise, we might do something like the following:
SELECT "username" FROM "users" WHERE "username" = 'eve' LIMIT 1;
This will return a single row containing only the username value if the username value is taken:

If the username is available, rows eve 1 and eve 2 try to create an account with the username eve at the same time:
Read now
Unlock full access