MySQL:
create table user
(
user_id int NOT NULL AUTO_INCREMENT,
name varchar(100),
phone varchar(100),
email varchar(100),
password varchar(100),
role_id int,
primary key(user_id),
unique index email_idx(email),
index role_idx(role_id)
);
Oracle:
create table user2
(
user_id int NOT NULL,
name varchar2(100),
phone varchar2(100),
email varchar2(100),
password varchar2(100),
role_id int,
primary key(user_id),
unique (phone),
foreign key (role_id) references role(role_id)
);
create unique index cu on user2 (email);
create index role_idx on user2 (role_id);
or
create table foo (a int primary key,
b varchar(20) unique);