User database

CEHJ
CEHJ used Ask the Experts™
on
Can anyone point me in the direction of the SQL DDL for a standard website user database? E.g. username, password, address etc.
 
Perhaps as part of a larger ecommerce db?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
create table USERS(
USR_ID numeric(10,0) identity,
USR_LOGIN varchar(20) not null,
USR_PWD varchar(15) not null,
USR_PWD_PHRASE varchar(100) null,
USR_PWD_ANSWER varchar(100) null,
USR_EMAIL varchar(50) not null,
USR_EMAIL_OK char(1) not null,
USR_CREATED_DATE datetime not null,
USR_CHANGE_DATE datetime not null)

the field USR_EMAIL_OK is must be set to 'N' until user confirm his email address by answer to the confirm email, then set to 'O'.

regards
Top Expert 2016

Author

Commented:
OK thanks. I'm toying with the notion of there being no id column though. Possibly email as PK...
Commented:
hello CEHJ,

Carrefull with PK on varchar type, it's really slowest than on numric type. It's also consume more disk space to build the index.

regards
Top Expert 2016

Author

Commented:
That's a point, thanks.
Top Expert 2016

Author

Commented:
Thanks. Although i've still not come  to a decision on how these things should be done!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial