18
3.相關的SQL語法 (8/10)
*Joint運算(1)
*列出購買過”資料庫的核心理論與實務”的產品的顧客姓名
SQL:
Select c.c_Name
From Customer as c, Order as o, Product as p
Where p.p_Name='資料庫的核心理論與實務' and o.pId=p.pId and c.mId=o.Mid
XML :
FOR  $p IN document("product.xml")//o_record[p_Name = '資料庫的核心理論與實務']
$o IN document("order.xml")//o_record[pId = $p/pId]
$c IN document("customer.xml")//c_record [mId=$o/mId],
     
  RETURN
        $c/c_Name