101k views
4 votes
Mysql Code

When coded in a WHERE clause, which of the following search conditions will not return a result set that includes all invoices with an invoice_total value of $1000 or less?
a. NOT (invoice_total > 1000)
b. invoice_total BETWEEN 0 AND 1000
c. invoice_total <= 1000
d. invoice_total IN (0, 1000)

1 Answer

4 votes

Answer: All of the search conditions mentioned will return a result set that includes all invoices with an invoice_total value of $1000 or less, as each of them is checking if the invoice_total value is less than or equal to 1000 in some form.

Explanation:

a. NOT (invoice_total > 1000) - This condition will return all invoices where the invoice_total is not greater than 1000, which means it includes all invoices where the invoice_total is less than or equal to 1000.

b. invoice_total BETWEEN 0 AND 1000 - This condition will return all invoices where the invoice_total is between 0 and 1000, inclusive, which means it includes all invoices where the invoice_total is less than or equal to 1000.

c. invoice_total <= 1000 - This condition will return all invoices where the invoice_total is less than or equal to 1000, which means it includes all invoices where the invoice_total is less than or equal to 1000.

d. invoice_total IN (0, 1000) - This condition will return all invoices where the invoice_total is either 0 or 1000, which means it includes all invoices where the invoice_total is less than or equal to 1000.

User Jim Counts
by
7.0k points