中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

5.1.4 Database Systems: The Condition Box

1. When it is diffcult or impossible to express all constraints on the domain variables within the skeleton tables, the condition box may be used.

2. To add the constraint that we are only interested in customers other than Jones to the above query, weinclude the condition box:

conditions
_xï¿¢ = Jones

3. To find all account numbers with balances between $1,300 and $1,500:

deposit bname account# cname balance
    P.   _x
conditions

_x≥1300

_x1500

 

4. Logical expressions and and or may appear in the condition box.

5. To find all account numbers where the balance is between $1,300 and $2,000, but is not $1,500:

deposit bname account# cname balance
    P.   _x
conditions

x = (≥1300 and ≤2000 and ï¿¢1500)

6. An unconventional use of the or construct allows comparison with several constant values:

conditions
_x = (Burnaby or Richmond)

Database System Structure: