Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
query based the first condition just discussed and

Query based the first condition just discussed and returns four rows

140 Chapter 3: Restricting and Sorting Data

Precedence

Operator Symbol

1

() Parentheses or brackets

2

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

Equality and inequality comparison

6

[NOT] LIKE, IS [NOT] NULL,
[NOT] BETWEEN

8

!=,<> Not equal to

9

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.

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Sarah Murray

PageId: ELIDCB03E4