C.1 Query-by-Example customer customer_name customer_street customer_city P.x Jones C.1.3 Queries on Several Relations QBE allows queries that span several different relations(analogous to Cartesian product or natural join in the relational algebra).The connections among the various relations are achieved through variables that force certain tuples to have the same value on certain attributes.As an illustration,suppose that we want to find the names of all customers who have a loan from the Perryridge branch.This query can be written as loan loan_number branch_name a17101u11f t Perryridge borrower customer-name loan_number 卫.y To evaluate the preceding query,the system finds tuples in loan with"Per- ryridge"as the value for the branch name attribute.For each such tuple,the system finds tuples in borrower with the same value for the loan number attribute as the loan tuple.It displays the values for the customer name attribute. We can use a technique similar to the preceding one to write the query"Find the names of all customers who have both an account and a loan at the bank": depositor customer_name account_number P_x borrower customer-name loan_number Now consider the query "Find the names of all customers who have an account at the bank,but who do not have a loan from the bank."We express queries that involve negation in QBE by placing a not sign(-)under the relation name and next to an example row: deposifor customer_name account_number P.x borrower customername loan_number -xC.1 Query-by-Example 5 customer customer_name customer_street customer_city P. x y Jones y C.1.3 Queries on Several Relations QBE allows queries that span several different relations (analogous to Cartesian product or natural join in the relational algebra). The connections among the various relations are achieved through variables that force certain tuples to have the same value on certain attributes. As an illustration, suppose that we want to find the names of all customers who have a loan from the Perryridge branch. This query can be written as loan loan_number branch_name amount x Perryridge borrower customer_name loan_number P. y x To evaluate the preceding query, the system finds tuples in loan with “Perryridge” as the value for the branch name attribute. For each such tuple, the system finds tuples in borrower with the same value for the loan number attribute as the loan tuple. It displays the values for the customer name attribute. We can use a technique similar to the preceding one to write the query “Find the names of all customers who have both an account and a loan at the bank”: depositor customer_name account_number P. x borrower customer_name loan_number x Now consider the query “Find the names of all customers who have an account at the bank, but who do not have a loan from the bank.” We express queries that involve negation in QBE by placing a not sign (¬) under the relation name and next to an example row: depositor customer_name account_number P. x borrower customer_name loan_number ¬ x