DATABASE 2 - MySQL

관계형 데이터베이스의 꽃 JOIN

댓글

댓글 본문
  1. 아리송
    2023.04.01
  2. 코드파괴자
    2023.03.23 완-
  3. ywbird
    2023.01.16
  4. 22.12.30
  5. 감자
    22.12.14
  6. 당당
    2022.11.05
  7. 아캔두잇
    20220815 완료
  8. join을 이용하여 분리된 테이블을 읽을 때 통합해서 읽을 수 있다.

    SELECT * FROM topic LEFT JOIN author ON topic.author_id = author.id;
    SELECT comment.id, description, name, profile FROM comment LEFT JOIN author ON comment.author_id = author.id;

    테이블을 분리함으로써 데이터 하나를 바꾸면 관련있는 모든 테이블들의 정보를 바꿀 수 있다.
  9. toonfac
    220705 오후 9시 59분 완료
  10. makeFun
    2022.06.25 re
  11. 시아
    영상에서...topic 테이블과 author 테이블을 합치고 나서는 topic_id의 순서가 12534로 틀어지는데 왜 그런 걸까요?
    author_id 순서로 바뀐건지...
  12. 1Q1S
    2022.02.02
  13. 드림보이
    2022.01.29. DATABASE2 - MySQL - 관계형 데이터베이스의 꽃 JOIN 파트 수강완료
  14. 코딩뽀시래기
    2022.01.26.수
  15. mirpia
    study
  16. heesang300
    2022.01.10 수강
  17. pmxsg
    2022.01.10. 수강
  18. chalieya
    관계형 데이터 베이스 강의 감사합니다.
  19. inventorh
    좋은강의 감사합니다!
  20. Alex
    210829
    - completed LEFT JOIN excise
    - SELECT Topic.id AS "TOPIC ID", profile, description from topic LEFT JOIN Author on Topic.author_id = Author.id
  21. Kangmin Kim
    2021.8.3
  22. Duke
    2021.08.01
  23. snoopy_thon
    21.07.06
  24. const.takeo
    코멘트 테이블까지 하실분

    create table comment (
    id int(11) not null auto_increment,
    description varchar(130) null,
    author_id int(11) null,
    primary key (id)
    );

    insert into comment (id, description, author_id)
    VALUES (1, 'mysql is awesome', 1);

    insert into comment (id, description, author_id)
    VALUES (2, 'postgres is awesome', 1);

    insert into comment (id, description, author_id)
    VALUES (3, 'I wanna be skilled-full back end developer', 2);

    insert into comment (id, description, author_id)
    VALUES (4, 'I wanna study more', 1);

    select comment.id as comment_id, description, name, profile from comment left join author on comment.author_id = author.id;
  25. 정훈
    감사합니다.
  26. 달려라자전거
    2021.05.19.
  27. 3개 테이블도 조인 성공
    감사합니다
  28. colatech
    21-03-31
  29. jwoh
    21-03-26
  30. hanel_
    21.3.14
  31. jeisyoon
    2021.03.05 MySQL JOIN - OK
  32. chimhyangmoo
    21.03.05
  33. 장휴일
    * 관계형 데이터베이스의 꽃 JOIN


    각각 독립적인(분리된) 테이블을 읽을 때, 그 테이블이 하나의 테이블로 저장되어 있었던 것과 같은 효과.

    테이블과 테이블을 JOIN 하기 위해서는,
    데이터베이스가 어떠한 목적을 가지고 있는지를 말할 수 있어야 한다.

    SELECT * FROM topic LEFT JOIN author ON topic.author_id = author.id;

    topic 테이블의 author_id 값과, author테이블의 id 값이 같다

    SELECT topic.id, title, description, created, name, profile FROM topic LEFT JOIN author ON topic.author_id = author.id;

    행을 보기 편하게 바꾸고 싶을 때,,

    AS 사용 : topic.id AS topic_id

    정보 기술에서 중복을 제외 한다는 것. !매 우 중 요!


    테이블을 분리한다는 것.
    만약 테이블이 특정 식별자를 가지고 있다면, JOIN을 통해 얼마든지 관계를 맺을 수 있다.


    SELECT * FROM comment LEFT JOIN author ON comment.author_id = author.id;

    UPDATE author SET profile='database administrator' WHERE id = 2;


    '하나를 바꾸면 전체가 바뀐다'


    ### JOIN은 관계형 데이터베이스를 관계형 데이터베이스 답게 만드는 명령어 ###
  34. 마아앙
    2021.02.15
  35. 밀키
    2021.02.13 수강 완료
  36. 불닭볶음면
    2021. 01. 24
  37. 이나라
    21.01.22
  38. Noah
    2021.01.10 완료!
  39. 생활둘기
    2021 1 1
  40. HyeonHui Jeong
    2020.12.22
  41. kkn1125
    20.12.19 완료~!
  42. 웹짱
    2020.12.09 관계형 데이터베이스 조인에 대해 배움
  43. 바부대지
    20.11.20
  44. 삼색냥
    20.10.30 Join 완료
  45. 콜라
    20201018완료
  46. JIEUN
    9/22 수강완료
  47. 유동균
    화이팅!
  48. jiyeong
    2020.08.29.
  49. 김민규
    JOIN으로 관계를 맺을 수 있는게 관계형DB이다.
  50. Jonghwo Lee
    완료
버전 관리
egoing
현재 버전
선택 버전
graphittie 자세히 보기