From the course: Advanced SQL: Logical Query Processing, Part 1

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Filtering source rows

Filtering source rows - SQL Tutorial

From the course: Advanced SQL: Logical Query Processing, Part 1

Start my 1-month free trial

Filtering source rows

- [Instructor] After the row set got evaluated and finalized in the from clause, it is passed on to the where clause. The where clause evaluates every row using the logical predicates. Only rows for which the predicate evaluates to true will live to see another clause. Rows that do not evaluate to true are discarded. The fact that the where clause is processed after the from clause is a very common cause for confusion regarding filtering with joint qualification predicate versus the where predicate. Look at these two queries, and try to guess whether or not they are equivalent using the content of sets A and B as shown on the slide. Pause the video for a minute, and guess. Let's do it together following processing order. First, a Cartesian product is created, and this is going to be true for both queries. The query on the left uses a composite qualification predicate for matching X values, and A.X larger than one. This…

Contents