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
Keyword and Parameter Description select_statement: This is a query which returns a result set of the rows. Its syntax is such that of select_ into_statement without the IN

Example of Tables within a Table - SQL Example: Obtaining C_ER from COURSE and EXAM_MARK SELECT CourseId, CAST (TABLE (SELECT DISTINCT StudentId, Mark FROM EXAM_MARK AS EM

Example of GROUP BY and COLLECT Operator Example: Using GROUP BY and COLLECT to obtain C_ER2 SELECT CourseId, CAST ( COLLECT (ROW (StudentId, Mark)) AS ROW (Studen

Assignment Source Not a Literal - Variable Syntax: SET SN = SID (SUBSTRING (SN.C FROM 1 FOR 1)||'5');

SSRS Report Writing Project Description: This report is part of a larger project to make a SQL Server Reporting Service (SSRS) based reporting solution. There can be more rep

Anatomy of a Command Figure, showing a simple SQL command, is almost identical to its counterpart in the theory book. The only difference arises from the fact that SQL uses a

Example of Foreign Key Constraint Example: Alternative formulation for 6.3 as a foreign key constraint ALTER TABLE EXAM_MARK ADD CONSTRAINT Must_be_enrolled_to_take_exam

Introduction Oracle 9i - it was made public in the year 2001 with over 400 features, and graphics, it has merged the traditional business with modern internet application

Example of Alternative formulation as a table constraint Example: Alternative formulation as a table constraint ALTER TABLE EXAM_MARK ADD CONSTRAINT Must_be_enrolled_to_

a. Create a table odetails_new. It has all the attributes of odetails and an additional column called cost, whose values are the product of the quantity and price of the part bein