Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed SQL Basics!
You have completed SQL Basics!
Preview
You're not restricted to displaying the column names from the table at the top of your results. You can specify your own names for result sets.
SQL Used
SELECT <column name> AS <alias> FROM <table name>;
SELECT <column name> <alias> FROM <table name>;
Examples:
SELECT username AS Username, first_name AS "First Name" FROM users;
SELECT title AS Title, year AS "Year Released" FROM movies;
SELECT name AS Name, description AS Description, price AS "Current Price" FROM products;
SELECT name Name, description Description, price "Current Price" FROM products;
See all of the SQL used in SQL Basics in the SQL Basics Cheat Sheet.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
This is a common practice and guarantees
that every row is not a duplicate of
0:00
another, and can be isolated
from all other rows if needed.
0:03
We have the title, author,
genre, and first_published.
0:07
Remember, querying a table's
contents allows us to present
0:13
the results of a database
in many different ways.
0:17
The results are designed for
humans to read.
0:20
But sometimes the column
names aren't that friendly.
0:23
Let's say I was running a query for
the library administrator.
0:26
They want a report of all the books in
the database along with the year that they
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up