38.0k views
4 votes
Assume you have a table listing the color T-shirts available in inventory. If you're using AND in a query to identify how many green and blue shirts are available, what type of result would you expect to receive? A. A list of all green shirts only B. A list of all shirts not green or blue C. A list of all blue shirts only D. A list of all green and blue shirts

2 Answers

2 votes
i believe the answer is d
User Muneeb Nasir
by
7.4k points
6 votes

Answer:

D. A list of all green and blue shirts

Step-by-step explanation:

Without the actual query used, it is uncertain how the AND keyword was used, and therefore the results obtained. In the strict sense of the AND meaning you may expect to obtain both green & blue tshirts. For that reason D option fits more appropriate than other choices.

However if not used carefully, a simple WHERE clause like this:

WHERE tshirt.color = "green" AND tshirt.color = "blue"

will return zero results, since the same tshirt.color field cannot be "green" & "blue" at the same time.

User Malek Ben El Ouafi
by
6.7k points