Basic Join Part 2
Coddy SQL 여정의 기초 섹션에 포함된 레슨 — 72개 중 44번째.
조인은 우리가 생성한 테이블에도 사용할 수 있습니다. 중첩 테이블을 조인과 결합하려면 중첩 쿼리를 이름으로 식별하기 위해 AS를 추가해야 합니다.
예를 들어:
SELECT table1.col1, table2.col2, ...
FROM table1, (SELECT * FROM table) AS table2
WHERE table1.id = table2.id챌린지
쉬움사용 가능한 테이블 및 컬럼:
<strong>grades</strong>:<strong>course_id</strong>,<strong>student_id</strong>,<strong>grade</strong><strong>students</strong>:<strong>id</strong>,<strong>name</strong>
각 학생에 대해 평균 점수를 계산하고 각 학생의 이름과 평균 점수를 반환하세요.
컬럼 이름을 student, grade로 지정하세요.
평균을 소수점 둘째 자리로 반올림하고 결과를 평균 점수 오름차순으로 정렬하세요.
치트 시트
중첩 쿼리로 테이블을 조인하려면, 중첩 쿼리에 이름을 지정하기 위해 AS를 사용하세요:
SELECT table1.col1, table2.col2, ...
FROM table1, (SELECT * FROM table) AS table2
WHERE table1.id = table2.id직접 해보기
이 레슨에는 짧은 퀴즈가 포함되어 있습니다. 레슨을 시작해 문제를 풀고 진행 상황을 기록하세요.
기초의 모든 레슨
4More Keywords
The IN keywordThe BETWEEN keywordThe LIKE keywordThe AS keywordRecap - Cellphone Models2Conditions
Conditions BasicsThe AND keywordThe OR keywordThe NOT keywordMultiple Conditions CombinedParenthesisBooleans5Arithmetic Operations
Mathematical OperatorsMathematical ColumnsThe Modulo OperationThe ROUND() Function3Specific Return Format
Null valuesSort Results Part 1Sort Results Part 2Recap - Cyber Security FirmLimit number of recordsRecap - Vehicle Factory6Intro Challenges
Recap - Parliamentary ElectionRecap - Police Criminal ArrestRecap - Bar Beverage ContainerRecap - Engineer new columns