04SQL2

Fall 2001 Basic SQL Query Language Correlated subquery Find names of customers with discnt = 10 who order product p05. Correlated subquery SQL - Nested Statements A nested sub-expression may refer to the tuples from the outer relation SQL - Exists SELECT FROM WHERE (NOT) EXISTS (SELECT * FROM R1, ..., Rm WHERE P) Semantics: For each tuple of the outer query, execute the inner query; if there is at least one tuple in the result of the inner query, then retrieve that tuple of the outer query. This accounts for the “there exists” type of queries SQL -EXISTS Two more neste

文档评论(0)

1亿VIP精品文档

相关文档