Question: Consider the bank database of Figure 16.9, where the primary keys are underlined. Construct the following SQL queries for this relational database. a. Write a
Consider the bank database of Figure 16.9, where the primary keys are underlined. Construct the following SQL queries for this relational database.
a. Write a nested query on the relation account to find, for each branch with name starting with B, all accounts with the maximum balance at the branch.
b. Rewrite the preceding query without using a nested subquery; in other words, decorrelate the query, but in SQL.
c. Give a relational algebra expression using semijoin equivalent to the query.
d. Give a procedure for decorrelating such queries.
Step by Step Solution
3.43 Rating (150 Votes )
There are 3 Steps involved in it
a SELECT accountaccountnumber accountbranchname FROM account WHERE a... View full answer
Get step-by-step solutions from verified subject matter experts
