Re: Nulls, integrity, the closed world assumption and events

From: Neo <neo55592_at_hotmail.com>
Date: 22 Jan 2007 15:58:46 -0800
Message-ID: <1169510326.559488.91130_at_11g2000cwr.googlegroups.com>


> 8. Data for Every 1
> http://www.tincat-group.com/mewsings/2006/03/data-for-every-1.html
> Specific example of an SQL query compared to an MV query.

Below I add iddy biddy dbd's query and view for comparison:

MV Query:
LIST PIZZAS WITH EVERY TOPPING <> "PEPPERS"

RMDB Query
SELECT P1.PIZZA_ID FROM PIZZA AS P1 WHERE P1.PIZZA_ID NOT IN (SELECT P2.PIZZA_ID FROM PIZZA_TOPPING AS P2 WHERE TOPPING = "PEPPERS") dbd query:
(& (get pizza instance *)

    (get * topping (!= (get topping instance *)

                             peppers)))


MV view of pizza:
PizzaID   Crust       Cheeses      Toppings
12345     Chicago    Mozzarella   Peppers
                             Provolone     Mushrooms
                                                Pepperoni
RMDB view of pizza:
PizzaID   Crust       Cheeses      Toppings
12345     Chicago    Mozzarella   Peppers
12345     Chicago    Mozzarella   Mushrooms
12345     Chicago    Mozzarella   Pepperoni
12345     Chicago    Provolone    Peppers
12345     Chicago    Provolone    Mushrooms
12345     Chicago    Provolone    Pepperoni

dbd's tree view of pizza:
pizza

   id

      12345
   crust

      chicago
   cheese

      mozzarella
      provolone
   topping
      peppers
      mushrooms
      pepperoni

Pizzas taste better when they grow on tall trees! Received on Tue Jan 23 2007 - 00:58:46 CET

Original text of this message