21.07.26 (월) - 쉰아홉번째 하루일기

Seungmin Shin·2021년 7월 27일

백엔드...아직까진 오케이

SQL 문법을 공부했다, 진짜 애매...하다 ㅋㅋㅋ
어찌보면 쉬운거 같기도 하고 아닌거 같기도 하고, 아직 딥하게 안들어가서 그런가..?

SELECT content.title, content.body, content.created_at, user.name
FROM category
JOIN content_category ON content_category.categoryId = category.id
JOIN content ON content.id = content_category.contentId
JOIN user ON user.id = content.userId
WHERE category.name = 'soccer'`

이런거 쓰고 해석해볼 줄.. 아는 거 까지 공부가 된 상태다.

진입장벽이 그리 크진 않은데 들어와서가 어려운거 같다, 특히 키워드들이 너~~무 많다
외워야할게 많다는것이다, 근데 그나마 다행인건 키워드들이 일반 영문법이라 그대로 해석하면
어느정도 볼 수 있다는게 그나마의 괜찮은 점이랄까?

저 코드를 봐도 그대로 해석하면 어렵지 않다,

SELECT 하겠다 content.title, content.body, content.created_at, user.name을,

FROM category에서,

JOIN content_category ON content_category.categoryId = category.id 은
content_category table 에 있는 content_category.categoryId 가
category table 에 있는 category.id 에 JOIN 한다는 뜻이다

WHERE category.name = 'soccer'
category 의 이름이 soccer 인것을 찾는다

뭐 대충 이런 느낌... 실제로 쓰이는 백엔드 SQL 구문을 한번 찾아봐야겠다
내가 얼마나 공부를 해야될지..

profile
Frontend Developer

0개의 댓글