How to find all pizzerias that serve every pizza eaten by people over 30?

后端 未结 9 1975
被撕碎了的回忆
被撕碎了的回忆 2020-12-29 07:29

I\'m following the Stanford Database course and there\'s a question where we have Find all pizzerias that serve every pizza eaten by people over 30 using Re

9条回答
  •  被撕碎了的回忆
    2020-12-29 08:13

    1. On slide 6, note that n is (3 1 7).

    2. On the next slide, o / n results in (4 8).

    3. If o would also have (12 3) and (12 1) but not (12 7), 12 would not be part of o / n.

    You should be able to fill in an example in the formula on Slide 16 and work it out.

    1. In your case, we take ɑ to be:

      Chicago Pizza   cheese  cheese
      Chicago Pizza   cheese  supreme
      Chicago Pizza   supreme cheese
      Chicago Pizza   supreme supreme
      Dominos         cheese  cheese
      Dominos         cheese  supreme
      
    2. Then we take β to be:

      cheese cheese
      cheese supreme
      supreme cheese
      supreme supreme
      
    3. The result of ɑ / β would then be:

      Chicago Pizza
      

    Dominos is not part of this because it misses (supreme cheese) and (supreme supreme).

提交回复
热议问题