Existential quantification - sql, PL-SQL Programming

Existential Quantification - SQL

Existential quantification-stating that something is true of at least one object under consideration-can be expressed by OR(r,c), meaning that at least one object that satisfies a predicate for r also satisfies c, and IS_NOT_EMPTY(r). The names for the aggregate operators AND and OR reflect the facts that when we confine our attention to finite sets, universal and existential quantification are equivalent to repeated invocations of dyadic AND and dyadic OR, respectively. Note that AND(r,c) is equivalent to COUNT(r) = COUNT(r WHERE c), and OR(r,c) is equivalent to COUNT(r WHERE c) > 0 and also to IS_NOT_EMPTY(r WHERE c).

Quantification also appears in various guises in SQL, but its meaning is muddied by those same two violations of relational theory that we have already seen muddying the waters: duplicate rows and NULL. For example, SQL's (SELECT COUNT(*) FROM r), a so-called scalar subquery (because it is an expression denoting a table with one row and one column, enclosed in parentheses), denotes the number of rows in the table r, but can we really say that this represents the number of objects that satisfy a predicate for r, if the same row can be counted more than once, or if NULL appears in place of a column value in some row of r? In fact, what might it mean to say that a row does or does not satisfy a predicate? In 2VL we say that object a satisfies predicate P(x) exactly when P(a) is true. Does this still hold in 3VL, or might SQL deem a to satisfy P(x) also when P(a) is unknown? Well, it turns out that SQL uses both interpretations, depending on the context, as we shall discover.

 

Posted Date: 1/18/2013 4:20:39 AM | Location : United States







Related Discussions:- Existential quantification - sql, Assignment Help, Ask Question on Existential quantification - sql, Get Answer, Expert's Help, Existential quantification - sql Discussions

Write discussion on Existential quantification - sql
Your posts are moderated
Related Questions
Assigning and Comparing Collections One collection can be assigned to other by an SELECT, INSERT, UPDATE, or FETCH statement, an assignment statement, or by a subprogram call. A

Using Invoker Rights: By default, the stored procedure executes with the privileges of its definer, not its invoker. These procedures are bound to the schema in which they inh

Transaction Control The Oracle is transaction oriented; that is, Oracle uses the transactions to make sure the data integrity. The transaction is a sequence of SQL data manip

What are 3 good practices of modeling and/or implementing data warehouses?

Example of GROUPBY Operator Example: How many students sat each exam, using GROUP BY, NATURAL LEFT JOIN, and COALESCE SELECT CourseId, COALESCE (n, 0) AS n FROM COURS

Fetching Across Commits The FOR UPDATE clauses acquire exclusive all row locks. All rows are locked when you open the cursor, and when you commit your transaction they are unl

Example of Table Literal - SQL Example: A Table Literal (correct version) VALUES ('S1', 'C1', 'Anne'), ('S1', 'C2', 'Anne'), ('S2', 'C1', 'Boris'), ('S3', 'C3'

Example of Using Aggregation on Nested Tables Example: How many students sat each exam WITH C_ER AS (SELECT CourseId, CAST (TABLE (SELECT DISTINCT StudentId, Mark FROM EXAM

DBMS_PIPE: The Package DBMS_PIPE allows various sessions to communicate over the named pipes. (A pipe is a region of memory used by one of the process to pass information to

%NOTFOUND The %NOTFOUND is the logical opposite of the %FOUND. The %NOTFOUND yields TRUE when an INSERT, UPDATE, or DELETE statement affected no rows, or the SELECT INTO state