The AS keyword
CoddyのSQLジャーニー「基礎」セクションの一部 — レッスン 21/72。
明確で記述的な列名は、データを意味のある方法で提示するために不可欠です。悪い列名のテーブルを表示すると、聴衆が何を話しているのか理解しにくくなります。
列名を変更するには AS キーワードを使用できます
SELECT col1 AS firstColumn, col2 AS secondColumn, ...
FROM table1チャレンジ
簡単利用可能なテーブルと列:
<strong>kitchen_items</strong>:<strong>cutlery</strong>,<strong>amount</strong>
amount が 3 個未満のすべてのキッチンアイテムを取得してください。cutlery 列の名前を silverware に変更してください
チートシート
列名を変更するには AS キーワードを使用します:
SELECT col1 AS firstColumn, col2 AS secondColumn
FROM table1自分で試してみよう
このレッスンには短いクイズがあります。レッスンを始めて解答し、進捗を記録しましょう。
基礎のすべてのレッスン
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