High School

We appreciate your visit to Construct a query to select counties with a population greater than 100 000 but only when the median income is below 20 000 per year. This page offers clear insights and highlights the essential aspects of the topic. Our goal is to provide a helpful and engaging learning experience. Explore the content and find the answers you need!

Construct a query to select counties with a population greater than 100,000, but only when the median income is below $20,000 per year.

A. SELECT * FROM counties WHERE pop > 100000 AND medinc < 20000
B. SELECT * FROM counties WHERE pop < 100000 AND medinc > 20000
C. SELECT * FROM counties WHERE pop > 100000 OR medinc < 20000
D. SELECT * FROM counties WHERE pop < 100000 OR medinc > 20000

Answer :

Final answer:

The correct SQL query to select counties with a population greater than 100,000 and a median income below $20,000 is SELECT * FROM counties WHERE pop > 100000 AND medinc < 20000.

Explanation:

To construct a query selecting counties with a population greater than 100,000 only when median income is below $20,000 per year, the correct SQL query would be:

SELECT * FROM counties WHERE pop > 100000 AND medinc < 20000;

This query filters the data in two steps. Firstly, it selects records where the population (pop) exceeds 100,000. Secondly, it narrows down these records to only include those where the median income (medinc) is less than $20,000. The logical operator AND ensures both conditions must be met for a record to be included in the results.

Thanks for taking the time to read Construct a query to select counties with a population greater than 100 000 but only when the median income is below 20 000 per year. We hope the insights shared have been valuable and enhanced your understanding of the topic. Don�t hesitate to browse our website for more informative and engaging content!

Rewritten by : Barada