๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

mysql

(2)
[MySQL] JOIN ๋ฌธ๋ฒ•, left join, left outer join, inner join ์œ„ ์‚ฌ์ง„์˜ ์ถœ์ฒ˜: https://yoo-hyeok.tistory.com/98 SQL join ๋ฌธ์ด ๊ฐ€์žฅ ์ž˜ ์ •๋ฆฌ ๋˜์–ด ์žˆ๋Š” ๊ทธ๋ฆผ์ธ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. join: ๋™์ผํ•œ column์„ ๊ธฐ์ค€์œผ๋กœ ํ…Œ์ด๋ธ”์„ ํ•˜๋‚˜๋กœ ํ•ฉ์นฉ๋‹ˆ๋‹ค. left(right) join ๊ณผ left(right) outer join์˜ ์ฐจ์ด์  ์‹คํ–‰ ๊ฒฐ๊ณผ๋Š” ๋™์ผ ํ•ฉ๋‹ˆ๋‹ค. left join์˜ ๊ฒฝ์šฐ ๋™์ผํ•œ column์œผ๋กœ ํ•˜๋‚˜๋กœ ํ•ฉ์ณ์ง€๊ณ  left ์ชฝ(A)์˜ ๋ชจ๋“  ๋ฐ์ดํ„ฐ๋ฅผ ํฌํ•จํ•˜๊ณ  B์˜ ๋ฐ์ดํ„ฐ๋Š” null๋กœ ํ‘œ์‹œ ๋ฉ๋‹ˆ๋‹ค. A ํ…Œ์ด๋ธ” id name 1 1 aaa 2 2 AAA B ํ…Œ์ด๋ธ” id name 1 2 AAA 2 3 bbb left join ๊ฒฐ๊ณผ A left join B id name id name 1 1 aaa null null 2 2 AAA 2 AAA ..
[DBeaver / MySQL] ๋ฌดํ•œ ๋กœ๋”ฉ ํ•ด๊ฒฐ DBeaver / MySQL ๋ฌดํ•œ ๋กœ๋”ฉ ํ•ด๊ฒฐ๋ฒ• ์ตœ๊ทผ ํŒ€์›๋“ค๊ณผ ์ง„ํ–‰ํ•˜๋Š” ๊ฐœ์ธ ํ”„๋กœ์ ํŠธ์—์„œ DB์กฐ์ž‘์„ ํ•˜๋Š”๊ฒฝ์šฐ๊ฐ€ ๋งŽ๋‹ค๋ณด๋‹ˆ DBeaver๊ฐ€ ๋ฌดํ•œ๋กœ๋”ฉ์ด ๊ฑธ๋ฆฌ๋Š” ๊ฒฝ์šฐ๋ฅผ ์ข…์ข… ๋ชฉ๊ฒฉํ•˜๊ฒŒ ๋์Šต๋‹ˆ๋‹ค. ๋ณดํ†ต ์ฟผ๋ฆฌ๋ฌธ์˜ ์š”๋ฅ˜๋‚˜ ์™ธ๋ถ€์š”์ธ์— ์˜ํ•ด์„œ ์ •์ƒ ์ข…๋ฃŒ๋˜์ง€ ์•Š์€ ์ƒํƒœ์—์„œ ๋‹ค๋ฅธ ๊ณณ์—์„œ SQL๋ช…๋ น์„ ์‹คํ–‰ํ–ˆ๊ธฐ์— DBeaver๊ฐ€ ์ด๋ฅผ ์ธ์‹ํ•˜์ง€ ๋ชปํ•˜๊ณ  ๊ณ„์† ์‹คํ–‰์„ ์š”์ฒญํ•˜๋‹ค๊ฐ€ ๋ฌดํ•œ ๋กœ๋”ฉ์ด ๊ฑธ๋ฆฌ๋Š” ๊ฒฝ์šฐ ์˜€์Šต๋‹ˆ๋‹ค. ์˜ˆ์‹œ, โ“โ” Java ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ํ†ตํ•ด query ์‹คํ–‰ -> ์˜ค๋ฅ˜ -> "DB ๋Œ€๊ธฐ ์ค‘" DBeaver๋ฅผ ํ†ตํ•ด query ์‹คํ–‰ -> "DB ๋Œ€๊ธฐ ์ค‘"์ด ๋๋‚ ๋•Œ ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆผ... -> ๋ฌดํ•œ ๋กœ๋”ฉ ์ด๋Ÿฐ ๋ชจ์Šต ํ˜น์€ ๋ฐ˜๋Œ€์˜ ๊ฒฝ์šฐ์ž…๋‹ˆ๋‹ค. ๊ฐ€์žฅ ๊ฐ„๋‹จํ•œ ํ•ด๊ฒฐ๋ฒ•์€ ์‚ฌ์šฉํ•˜๋Š” DB ์ €์˜ ๊ฒฝ์šฐ MySQL ์„œ๋น„์Šค๋ฅผ ์žฌ์‹œ์ž‘ํ•˜๋Š” ๊ฒƒ (๊ฐœ์ธ ํ”„๋กœ์ ํŠธ๋‚˜..

728x90