Skip to content

siazon/GarbageSorting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GarbageSorting

API

Login

url: http://127.0.0.1:8081/Login
method: get
Param: ?username=admin&password=123456
return: string msg

Sign up

url: http://127.0.0.1:8081/InsertUser
method: post
body: {"user_email":"","user_name":""}
return: string msg

allScores

url: http://127.0.0.1:8081/allScores
method: get

return: json list

insertScore

url: http://127.0.0.1:8081/allScores
method: post
body: json User
return: json list

Mysql

DROP DATABASE IF EXISTS garbagesorting;
CREATE DATABASE garbagesorting;

Use garbagesorting;

drop table if exists tb_user;
CREATE TABLE tb_user(
id INT PRIMARY KEY AUTO_INCREMENT,
user_name VARCHAR (255) NOT NULL,
user_email VARCHAR (255) NOT NULL,
user_phone VARCHAR(255),
user_password VARCHAR(255),
user_role VARCHAR(255),
user_status VARCHAR(255) 
);

select * from tb_user;

drop table if exists scores;
CREATE TABLE scores(
user_score INT,
user_id INT,
constraint user_scores foreign key(user_id) references tb_user(id)
on delete cascade on update cascade
);

select * from scores;

-- Create view to find user by id
drop view if exists user_score;
create view user_score as
select tb_user.user_name, scores.user_id, scores.user_score from scores inner join tb_user on scores.user_id = tb_user.id;

select * from user_score;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •