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

Elizabeth Ekhuemelo
Elizabeth Ekhuemelo
677 Points

What have I done wrong?

I have been trying to write the query/code to find out the customer details for first_name ad second_name.

Steven Parker
Steven Parker
229,644 Points

Show your code here and we can take a look. Please also post a link the course page you are working with.

2 Answers

It will be helpful if you paste the link to the problem or a more detail explanation but I will try and answer this ,hopefully it will help. lets assume the table name is USERS, and have four columns in it, namely id, first_name, last_name and phone.

to get the first_name and last_name of all the users in the USERS table, you first use the SELECT keyword which indicate that its to read from a table/view . Then the columns you want to output each separated by a comma (,) . Then use the FROM keyword and specify the table name (USERS). i.e

SELECT first_name, last_name FROM USERS;

Prem Yadav
Prem Yadav
7,346 Points

SELECT first_name ,last_name FROM (table name);