-
Notifications
You must be signed in to change notification settings - Fork 1
/
member.sql
46 lines (36 loc) · 1.58 KB
/
member.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 회원가입(USER_SIGNUP_001)
insert into member (userid,username,email,
nickname,password,birth_date,gender)
values("woo975",'최원익',"[email protected]",
"버스탈게요","qwer1234",'1997-11-11','male');
# 회원정보 수정(USER-UPDATE-01)
update member set gender="female" where id=2;
# 회원정보 수정 접근 보안 보안을 위한 비밀번호 확인 로직(USER-UPDATE-02)
select * from member where userid="woo975" and password="qwer1234";
# 비밀번호 변경(USER-UPDATE-03)
update member set password="1111" where id=2;
# 정보 수정 보안(USER-UPDATE-04)
select * from member where userid="woo975" and password="1111";
# email인증으로 아이디 찾기(USER-READ-01)
select userid from member where email="[email protected]";
# 비밀번호 재설정(USER-UPDATE-05)
update member set password="1111" where email="[email protected]"; -- id pk 값이나 userid 값으로 바꾸는 것이 더 나은지 확인해보기?
# 회원 탈퇴(USER-DELETE-01)
UPDATE member
SET is_deleted = TRUE, username="탈퇴한 사용자",
deleted_at = NOW()
WHERE id = 100005;
# 일반 로그인(USER-LOGIN-01)
select * from member where userid='woo975' and password='1111';
# 판매 게시글 관리(USER-POST-01)
select * from product
left join member on member.id=product.member_id
where member.id=3;
# 거래내역 관리(USER-PAYMENT-01)
select orders.order_status, orders.created_at,orders.id,
orders.amount, book.title
from orders
left join member on member.id= orders.member_id
left join product on product.id = orders.id
left join book on book.id = product.book_id
where member.id=2;