Projection and existential quantification - sql, PL-SQL Programming

Projection and Existential Quantification - SQL

Intuitively it might seem that projection in SQL is simply a matter of specifying the required columns in the SELECT clause, as in Example.

Example: Projection (incorrect)

Student StudentId is enrolled on some course.

SELECT StudentId FROM IS_ENROLLED_ON

Unfortunately, though, if some student is currently enrolled on more than one course (as indeed student S1, Anne, is in our example database), then the row giving that student's id appears twice in the result, which because of that duplicate appearance does not represent a relation. To avoid multiple appearances of the same row SQL requires you to write the word DISTINCT. (The key word ALL can be given instead of DISTINCT, clarifying that duplicate rows are not to be eliminated. As ALL is the default option).

Posted Date: 1/18/2013 5:09:17 AM | Location : United States







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

Write discussion on Projection and existential quantification - sql
Your posts are moderated
Related Questions
Table Literals - SQL One might expect SQL to support table literals in the manner illustrated in Example 2.2, but in fact that is not a legal SQL expression. Example: Not a

Cursors The Oracle uses work areas to execute the SQL statements and to store process information. A PL/SQL construct known as the cursor. Let's you assume name a work area and

Explicit Cursors The set of rows returned by the query can include zero, one, or multiple rows, depending on how many rows meet your search criteria. Whenever a query returns

Block Structure The PL/SQL is a block-structured language. That is, the fundamental units (procedures, anonymous blocks, and functions) that make up a PL/SQL program are logi

Example of Null operator - NiNo Rule If we wanted to make HIGHER_OF adhere to "NULL in, NULL out"-let's call it the NiNo rule-we would have to write something like what is sho

Create a view named CustomerAddresses that shows the shipping and billing addresses for each customer in the MyGuitarShop database. This view should return these columns from the

GOTO Statement The GOTO statement branches to a label unconditionally. The label must be exclusive within its scope and should precede an executable statement or a PL/SQL block.

Semidifference via EXCEPT and JOIN - SQL SELECT * FROM (SELECT StudentId FROM IS_CALLED WHERE Name = 'Devinder' EXCEPT DISTINCT CORRESPONDING SELECT StudentId

Named Notation The second procedure call uses the named notation. An arrow (=>) serve as the relationship operator that associates the formal parameter to the left of the arro

Example of EXCEPT Operator - SQL Example, like its counterpart in the theory book, illustrates the convenience of allowing any table expression to be the source for an INSERT