Over 10 Million Study Resources Now at Your Fingertips

Download as :
Rating : ⭐⭐⭐⭐⭐
Price : $10.99
Pages: 2

Query based the first condition just discussed and returns four rows

140 Chapter 3: Restricting and Sorting Data


Operator Symbol


() Parentheses or brackets


/,* Division and multiplication
+,− Addition and subtraction
|| Concatenation

Equality and inequality comparison




!=,<> Not equal to


NOT NOT logical condition
AND AND logical condition
OR OR logical condition

Figure 3-16 illustrates three queries. Query 1 returns four rows. Query 2 is based on the first condition just discussed and returns four rows. Query 3 is based on the second condition and returns zero rows.

Changing the order of the conditions in the WHERE clause changes its meaning due to the different precedence of the operators. Consider the following code sample:

There are two composite conditions in this query. The first condition retrieves the records with the character “a” in the LAST_NAME field ANDa SALARY value greater than 100 times the DEPARTMENT_ID value AND where the COMMISSION_PCT value is not null. The second condition fetches those rows with JOB_ID values of MK_MAN. A row is returned by this query if it conforms to either condition one ORcondition two but not necessarily to both.

As Figure 3-17 illustrates, this query returns six rows. It further shows the division of the query into two queries based on its two composite conditions. The first condition results in five rows being returned while the second results in the retrieval of just one row with a JOB_ID value of MK_MAN.

How It Works
Login account
Login Your Account
Add to cart
Add to Cart
Make payment
Document download
Download File
PageId: ELIDCB03E4
Uploaded by :
Page 1 Preview
query based the first condition just discussed and
Sell Your Old Documents & Earn Wallet Balance