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

PHP

Creating the Products Table

Q: Write the SQL query to select 'name' and the 'price' from the 'products' table.

A: SELECT * FROM products WHERE (name, price)

This seems like such a simple question, how come I cannot figure it out.

2 Answers

Hey Krystel,

I think you might be overthinking it!

Try this: SELECT name, price FROM products;

PS. It's awesome that you're from Arizona.

Thank you so much! And its awesome 3/4 of the time.

Ha! If that. It's only awesome if your air conditioner works. But you're the first local I've run into on Treehouse so I got all giddy.

You are also the first local I have met through here! Its nice to know that at least someone else around here is learning the same way I am lol :)

Haha I know what you mean. But at the same time, I feel like I'm exclusive and better than everyone else for learning this way haha :)

I am from AZ

SELECT is where you choose what to select from the table. WHERE is when you want to specify something associated with what you're selecting.

SELECT name FROM Users WHERE email = 'Krystel@someemail.com'

This query would return the name in the row of the database where the WHERE condition is met.