Proving SQL query equivalency

后端 未结 9 2431
一整个雨季
一整个雨季 2020-12-15 05:33

How would you go about proving that two queries are functionally equivalent, eg they will always both return the same result set.


As I had a specific query in

9条回答
  •  鱼传尺愫
    2020-12-15 05:58

    Perhaps you could draw (by hand) out your query and the results using Venn Diagrams, and see if they produce the same diagram. Venn diagrams are good for representing sets of data, and SQL queries work on sets of data. Drawing out a Venn Diagram might help you to visualize if 2 queries are functionally equivalent.

提交回复
热议问题