Dumies collection

Page 206

186

Part III: Storing and Retrieving Data

ANY can be ambiguous The original SQL used the word ANY for existential quantification. This usage turned out to be confusing and error-prone, because the English language connotations of any are sometimes universal and sometimes existential:

is. Any is used as an existential quantifier. The second sentence, however, is a boast that’s stating that I can eat more eggs than the biggest eater among all you people can eat. In this case, any is used as a universal quantifier.

⻬ “Do any of you know where Baker Street is?”

Thus, for the SQL-92 standard, the developers retained the word ANY for compatibility with early products, but they also added the word SOME as a less confusing synonym. SQL continues to support both existential quantifiers.

⻬ “I can eat more eggs than any of you.” The first sentence is probably asking whether at least one person knows where Baker Street

Another example: Premise 1: Some Greeks are women. Premise 2: All women are human. Conclusion: Some Greeks are human. By way of presenting a third example, let me state the same logical idea of the second example in a slightly different way: If any Greeks are women and all women are human, then some Greeks are human. The first example uses the universal quantifier ALL in both premises, enabling you to make a sound deduction about all Greeks in the conclusion. The second example uses the existential quantifier SOME in one premise, enabling you to make a deduction about some Greeks in the conclusion. The third example uses the existential quantifier ANY, which is a synonym for SOME, to reach the same conclusion you reach in the second example. Look at how SOME, ANY, and ALL apply in SQL. Consider an example in baseball statistics. Baseball is a physically demanding sport, especially for pitchers. A pitcher must throw the baseball from the pitcher’s mound to home plate between 90 and 150 times during a game. This effort can be exhausting, and if (as is often the case) the pitcher becomes ineffective before the game ends, a relief pitcher must replace him. Pitching an entire game is an outstanding achievement, regardless of whether the effort results in a victory.


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.