(Q13) For each book whose price is greater than the average price, return the title of the book and the amount by which the book's price exceeds the average price.
<result>
LET $a := avg(//book/price)
FOR $b IN /book
WHERE $b/price > $a
RETURN
<expensive_book>
$b/title ,
<price_difference>
$b/price - $a
</price_difference>
</expensive_book>
</result>
|
|||
|