sql make sure every user is unqiuew

Solutions on MaxInterview for sql make sure every user is unqiuew by the best coders in the world

showing results for - "sql make sure every user is unqiuew"
Giovanni
09 Jan 2020
1create table user(
2    user_id  INT  auto_increment  PRIMARY KEY,
3    username varchar(50) not null,
4    avator  varchar(50),
5    gender  boolean not null,
6    phone varchar(20),
7    unique(username)
8);
9
10create table journey(
11    id INT auto_increment PRIMARY KEY,
12    start varchar(100) not null,
13    dest varchar(100) not null,
14    time date not null,
15    person INT,
16    user_id INT not null,
17    foreign key(user_id) references user(user_id)
18);
19