Menu
CoddyTech

The AS keyword

Part of the Fundamentals section of Coddy's SQL journey. Lesson 21 of 72.

Clear and descriptive column names are essential for presenting data in a meaningful way. If you show a table with bad column names, it will be hard for your audience to understand what you are talking about.

To rename a column in the query result you may use the AS keyword. The new name only changes the result's column header: the table itself keeps its original column names.

SELECT col1 AS firstColumn, col2 AS secondColumn, ...
FROM table1
challenge icon

Challenge

Easy

Available tables and columns:

  • kitchen_items: cutlery, amount

Fetch all of the kitchen items whose amount is less than 3. Return both columns: cutlery renamed to silverware, and amount.

Try it yourself

quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals

Practice on your own: SQL playground