Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases SQL Basics Getting Data from a Database Retrieving Specific Columns of Information

We're still in the e-commerce database. This time, from the products table, get the name of every product.

can anyone help me out with this query

2 Answers

Steven Parker
Steven Parker
229,732 Points

You've already passed a harder challenge task. For this one, you just need to select the column named "name" from the table named "products".

Give it a shot, and if you still have trouble, show your complete query code here for more specific help.

Hi, sorry i am still having trouble not really sure what to do. thanks

Steven Parker
Steven Parker
229,732 Points

You already passed task 1 to get to task 2, try doing this task in a similar way to how you did task 1. Give it your best shot and if you still have trouble, show the query you are trying here.

alright the answer i got was SELECT name AS "Product Name", description AS "Product Description" FROM products; but this was incorrect and i tried many variations but still cannot get this

Steven Parker
Steven Parker
229,732 Points

You're working too hard, and getting more data than the instructions ask for. Remember, the task here is "from the products table, get the name of every product".

So you don't need the description at all, and you don' t need a column alias.

Hi, I have also tried SELECT Product_name From products table; and many like this but don't seem to get any luck.

Steven Parker
Steven Parker
229,732 Points

There's no "Product_name" column in the "products" table. The column that the instructions ask you to select is "name", And when you identify a table, you use only it's name without the word "table".

I'll bet you can get it now.

Oh ok so would it be SELECT name FROM Product

Steven Parker
Steven Parker
229,732 Points

You're very close! But the name of the table is "products" (with an "s").

Thanks for your help Steven.

Hi Guys,

I'm having a similar problem, what am I missing in my code :

select name from products;

Steven Parker
Steven Parker
229,732 Points

Instead of posting a question as an "answer" to another one, you should always start a fresh question and include both your complete code and a link to the course page. The code inclusion and links should be done automatically by using the "Get Help" button in a challenge to create the question.