Explore BrainMass
Share

Using OR, AND, ANY, and ALL with SQL queries

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

The OR and AND operators are used in compound conditions. Is there any relationship between these operators and the ALL and ANY operators? Outside references are required.

© BrainMass Inc. brainmass.com October 25, 2018, 1:51 am ad1c9bdddf
https://brainmass.com/computer-science/sql/using-or-any-all-sql-queries-277314

Solution Preview

The MySql operators OR and AND can be used in conditions in a query. For example:

SELECT * FROM mytable WHERE id > 100 AND age < 65;

This statement selects all the items from the table where the id is
greater than 100 AND the age is less than 65. Both conditions must be
met. Likewise, the following query uses the OR operator:

SELECT * FROM mytable ...

Solution Summary

This solution shows how to use OR, AND, ANY, and ALL in SQL queries. It also explains how they work.

$2.19
See Also This Related BrainMass Solution

Structured Query Language Skills

Customer Volume by Month
• CustomerID
• Month
• Total shipments
• Total weight
Driver Performance by Month
• Driver ID
• Month
• Number of manifests on time
• Number of manifests delivered late
In order to create the SQL select statements that would produce running summary files for reports of the above; how would you answer the questions below?
• From where should they source the information for the design?
• What difficulties would they have in writing the SQL statements for each of these tables?
• Should any of these tables be created on an as-needed basis?
• Do these summary tables violate the concept of table normalization?
Guidelines
Answer four questions above and provide any examples, tables, or SQL statements that you created to arrive at your solutions.

View Full Posting Details