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

facing difficulty in WHERE

WHERE

Steven Parker
Steven Parker
231,269 Points

Can you be more specific about what kind of difficulty you are having? If it relates to a query, please show the entire query. And if it's part of a challenge, please provide a link to the challenge page.

We have a database that runs a sports team's website. In the results table we have the columns like id, home_team, home_score, away_team, away_score, played_on. question: Find all results where the home team's score is above 12.

Steven Parker
Steven Parker
231,269 Points

That sounds like instructions for a challenge. Please provide a link to the challenge page, and also show the entire SQL query that you have constructed so far.

1 Answer

Luc de Brouwer
seal-mask
.a{fill-rule:evenodd;}techdegree
Luc de Brouwer
Full Stack JavaScript Techdegree Student 17,939 Points

Hi Reddy,

The basic syntax for a WHERE clausule is very simple :

SELECT rows FROM table WHERE row(s) LIKE 'value';

So to provide an answer for your problem, try something like this : SELECT * FROM results WHERE home_score > 12;

If you want more information about SQL and its syntax I highly suggest you visiting W3schools. As a reference to this subject here is a link that should help you in the future : https://www.w3schools.com/sql/sql_where.asp