Choosing columns
Picking columns
SELECT * returns every column. Usually you want only a few. Instead of *, list the columns you want, separated by commas:
The result has just those columns, in the order you wrote them.
열 선택하기
SELECT *은 모든 열을 반환합니다. 보통은 몇 개의 열만 원합니다. * 대신 원하는 열을 나열하고 쉼표(,)로 구분하세요:
SELECT name, score FROM student;
결과에는 나열한 순서대로 해당 열만 포함됩니다.
Renaming a column with AS
You can rename a column in the result with AS. This does not change the table — only the heading shown:
The headings become pupil and mark. This is handy for clear reports.
AS로 열 이름 변경하기
AS을 사용하면 결과 내에서 열 이름을 변경할 수 있습니다. 이는 실제 표를 변경하지 않으며, 표시되는 제목만 바꿉니다:
SELECT name AS pupil, score AS mark FROM student;
제목이 pupil 및 mark로 변경됩니다. 이는 명확한 보고서 작성에 유용합니다.
Common mistakes
- List the columns you want, separated by commas.
ASrenames a column in the result.
흔한 실수
- 원하는 열을 나열하고, 쉼표(,)로 구분하세요.
AS는 결과에서 열의 이름을 변경합니다.
SELECT picks columns
Choosing columns keeps only the fields you name.
Select only the name and score columns from student, in that order.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Select name and score, but rename the headings to pupil and mark using AS.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.