operator joins two or more conditions, and displays a row only if that row's data satisfies
conditionslisted (i.e. all conditions hold true).
To display all staff making over $40,000, use:The
operator joins two or more conditions, but returns a row if
of the conditions listed hold true.
To see all those who make less than $40,000 or have less than $10,000 in benefits, listed together, use the followingquery:AND & OR can be combined, for example:
Find all managers whose salary is greater than 60000 and benefits are greater than 12000
IN & BETWEEN
An easier method of using compound conditions uses
For example, if you wanted to list all managers and staff:
To list those making greater than or equal to $30,000, but less than or equal to $50,000, use:
To list everyone not in this range, try:
Look at the EmployeeStatisticsTable, and say you wanted to see all people whose last names started with "S"; try:
In this section, we will only discuss
, as in general, they are the most useful. For moreinformation, try the SQL links at the bottom of the page.Good database design suggests that each table lists data only about a single
, and detailed information can beobtained in a relational database, by using additional tables, and by using a