正在加载图片...
C.1 Query-by-Example 7 As yet another example,suppose that we modify the final query in Sec- tion C.1.3 to be"Find all customers who are not named Jones'and who have at least two accounts."We want to include an"x Jones"constraint in this query. We do that by bringing up the condition box and entering the constraint"x-= Jones": conditions x=Jones Turning to another example,to find all account numbers with a balance between $1300 and $1500,we write account account_number branch_name balance P. conditions -x≥1300 -x≤1500 As another example,consider the query"Find all branches that have assets greater than those of at least one branch located in Brooklyn."This query can be written as branch branch_name branch-city assets 卫-x y Brooklyn conditions y>_z QBE allows complex arithmetic expressions to appear in a condition box.We can write the query"Find all branches that have assets that are at least twice as large as the assets of one of the branches located in Brooklyn"much as we did in the preceding query,by modifying the condition box to conditions y22*-2 To find the account number of accounts with a balance between $1300 and $2000,but not exactly $1500,we writeC.1 Query-by-Example 7 As yet another example, suppose that we modify the final query in Sec￾tion C.1.3 to be “Find all customers who are not named ‘Jones’ and who have at least two accounts.” We want to include an “x = Jones” constraint in this query. We do that by bringing up the condition box and entering the constraint “ x ¬ = Jones”: conditions -x ¬ = Jones Turning to another example, to find all account numbers with a balance between $1300 and $1500, we write account account_number branch_name balance P. x conditions x ≥ 1300 x ≤ 1500 As another example, consider the query “Find all branches that have assets greater than those of at least one branch located in Brooklyn.” This query can be written as branch branch_name branch_city assets P. x y Brooklyn z conditions y > z QBE allows complex arithmetic expressions to appear in a condition box. We can write the query “Find all branches that have assets that are at least twice as large as the assets of one of the branches located in Brooklyn” much as we did in the preceding query, by modifying the condition box to conditions y ≥ 2 * z To find the account number of accounts with a balance between $1300 and $2000, but not exactly $1500, we write
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有