Consider the relation account (customer, balance) where customer is a primary key and there are no null values. We would like to rank customers according to decreasing balance. The customer with the largest balance gets rank 1. Ties are not broke but ranks are skipped: if exactly two customers have the largest balance they each get rank 1 and rank 2 is not assigned query1: select a.Customer, count(b.Customer) from account a, account b where a.Balance <=b.Balance group by a.Customer
Answers
Answered by
0
Answer:
Explanation:
"
Query 1 and Query 2 will have the same result if we take customers to have different balance.
So, for some databases, the result of query 1 and query 2 will be same. Lets take into account, we take entries in the database have the same value for balance. In normal scenario, all the customers should have rank 1 , but both the queries will the customer rank which is going to be equal to the number of customers in the database.
"
Similar questions
India Languages,
6 months ago
History,
6 months ago
Biology,
6 months ago
World Languages,
1 year ago
Computer Science,
1 year ago
Math,
1 year ago