Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/config/pr-validation.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"owners": [],
"userToBranch": {

"muxlpaq": "hagyeong",
"jihyun": "ella",
"minji-jeong516": "minji"
}
}
}
38 changes: 38 additions & 0 deletions week01/keyword/keyword.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
- 외래키(FK)

데이터베이스 테이블의 Foreign Key를 표현함
외래키를 표시할 때에는 선을 이어주는데 개체와 관계를 따져 표시
관계에서 다른 객체의 PK의 값을 나타냄

- 기본키(PK)

PrimaryKey를 표현
테이블에서 각 행을 유일하게 식별하는 값
중복이 없고 NULL 값이 없는 유일한 값에 지정하는 식별자

- ER 다이어그램

Entity 개체와 Relationship 관계를 중점적으로 표시하는 데이터베이스 구조를 한 눈에 알아보기 위해 그려놓는 다이어그램
개체 관계도라고도 불리며 요구분석사항에서 얻은 엔티티와 속성들의 관계를 그림으로 표현한 것

- 복합 키

PK를 컬럼 하나가 아니라 두 개 이상으로 묶어서 만든 것으로 묶어야 비로소 한 행을 식별할 수 있을 때 복합키를 사

- 연관관계

테이블 간의 관계
1. 1 대 1 대응
2. 1 대 다 대응
3. 다 대 다 대응
이 존재한다.

- 정규화

테이블을 잘게 쪼개서 중복을 없애는 것

[정보처리 실기_데이터베이스06강_정규화](https://youtu.be/RXQ1kZ_JHqg?si=f0OPsoOWnJXSbqca)

- 반 정규화

정규화를 일부러 되돌리는 것으로 성능을 위해 중복을 허용하는 것 (테이블을 너무 잘게 쪼개면 join을 많이 해야 해서 쿼리가 느려질 수 있어서 자주 쓰는 데이터를 중복 저장해 join 없이 빠르게 조회할 수 있게 만든다.)
114 changes: 114 additions & 0 deletions week01/mission/erd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
IA(무엇이 존재하는지)

1. IA 구조에서 명사 찾기(동사/속성 제외)

: 미션, 리뷰, 가게, 포인트

2. 저장이 필요한지 체크(여러 개 존재? 각각 식별? 데이터 변화 이력이 쌓여야 하나?)

: 현재 내 포인트 관리 부분은 설계 하지 않아도 되므로 속성으로 판단할 경우 미션, 리뷰, 가게

3. IA 페이지 내 CRUD 동사 찾아 추가 확보 : x

⇒ IA의 경우 **미션, 리뷰, 가게 개체**

WF(사용자가 무엇을 입력/조작하는지)

1. 입력 폼의 필드 묶음 찾기(폼 하나는 개체 하나고 필드들은 속성)

: 회원(이름, 성별, 생년월일, 주소, 선호하는 **음식** 종류, 약관), 문의(문의 제목, 문의 유형, 문의 내용, 사진), 리뷰(별점, 리뷰 내용, 사진)

2. 목록/카드 UI 찾기(반복 되는)

: 미션(전체 달성 수 제시), 회원(포인트, 휴대폰번호, 이메일, 닉네임, 작성한 리뷰- **리뷰 답글**, 작성한 문의 내역, 로그아웃, 계정 탈퇴)

3. 버튼/액션이 연결하는 두 명사 찾기(ex A를 B에 담기)→매핑 테이블 잡음

: 미션_수행 (회원이 미션 수행함 / 어떤 미션(가게명,미션), 진행 단계), 음식_선호도 (선호하는 음식 종류 여러개 고름)


⇒ WF의 경우 **회원, 문의, 리뷰, 미션, 음식_카테고리, 리뷰답 개체 / 미션_수행, 음식_선호도 매핑 테이블**

IA, WF의 결과로 개체 **회원, 미션, 가게, 리뷰, 문의, 음식_카테고리**로, 매핑 테이블 **미션_수행, 음식_선호도**로 두고 ERD 구현 시작

### 개체

1. **회원**

![image.png](images/1-1.png)

질문?! 일시들의 timestamp vs datetime

⇒ datetime — 그냥 입력한 날짜/시간 그대로 저장, timestamp — 저장할 때 자동으로 UTC 기준으로 변환해서 저장, 조회할 때 서버 시간대에 맞게 변환해서 보여줌

2. **미션**

![image.png](images/1-2.png)

3. **가게**

![image.png](images/1-3.png)

4. **리뷰**

![image.png](images/1-4.png)

5. **리뷰 답글**

![image.png](images/1-5.png)

6. **문의**

![image.png](images/1-6.png)

7. **음식_카테고리**

![image.png](images/1-7.png)

### 매핑

1. **미션, 가게**

![image.png](images/2-1.png)

가게에 여러 미션 존재, 한 미션은 가게에 하나 존재

2. **리뷰, 가게**

![image.png](images/2-2.png)

가게에 여러 리뷰 가능, 리뷰 하나가 여러 가게 불가능

3. **리뷰, 리뷰 답글**

![image.png](images/2-3.png)

하나의 리뷰에 여러 리뷰 답글 가능, 리뷰 답글 하나에 여러 리뷰 불가

4. **유저, 문의**

![image.png](images/2-4.png)
한 회원당 여러 문의 가능, 문의 하나를 여러 회원이 불가

5. **유저, 리뷰**

![image.png](images/2-5.png)

한 유저당 여러 리뷰 가능, 리뷰를 여러 유저가 작성 불가

6. **유저, 음식카테고리**

![image.png](images/2-6.png)

선호 음식 카테고리 매핑 테이블 생성
여러 유저가 선호 음식 여러 개 선택 가능, 여러 음식이 여러 유저한테 선택될 수 있음

7. **유저, 미션**

![image.png](images/2-7.png)
한 유저가 여러 미션 수행 가능, 여러 유저가 한 미션 수행 가능

### 최종 ERD
![image.png](images/erd.png)

노션 링크 : https://www.notion.so/makeus-challenge/Chapter-1-Database-31fb57f4596b818888c5eb48085ee207
Binary file added week01/mission/images/1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/1-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/1-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/1-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/1-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/1-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/2-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/2-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/2-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/2-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/2-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/2-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added week01/mission/images/erd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading