Example of except operator - sql, PL-SQL Programming

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. It assumes that all the exam scripts submitted by students have been marked and it has been decided to record marks of zero for students who failed to turn up for an exam they should have sat. (Remember that SQL's EXCEPT requires its operands to be of the same degree, unlike NOT MATCHING-hence the third element, 0, of the second operand in the example.)

Example: Awarding zero marks to students who failed to take the exam

INSERT INTO EXAM_MARK

SELECT StudentId, CourseId, 0

FROM IS_ENROLLED_ON

EXCEPT

SELECT StudentId, CourseId, 0

FROM EXAM_MARK;

Posted Date: 1/18/2013 11:37:41 PM | Location : United States







Related Discussions:- Example of except operator - sql, Assignment Help, Ask Question on Example of except operator - sql, Get Answer, Expert's Help, Example of except operator - sql Discussions

Write discussion on Example of except operator - sql
Your posts are moderated
Related Questions
Restriction in SQL Syntax: SELECT DISTINCT StudentId FROM IS_CALLED WHERE Name = 'Boris' The WHERE clause operates on the result of the FROM clause in analogo

%FOUND Until the SQL data manipulation statement is executed, the %FOUND yields NULL. Afterward, the %FOUND yields TRUE, when an INSERT, UPDATE, or DELETE statement affected o

Using COMMIT The COMMIT statements end the present transaction and make permanent any changes made during that transaction. Till you commit the changes, other users cannot acc

CURRVAL and NEXTVAL The series is a schema object which generates the sequential numbers. Whenever you form a sequence, you can specify its primary value and an increment. T

SELECT a.child_fname,a.child_lname,concat(b.parent_title,b.parent_fname), b.parent_lname,b.parent_tphone FROM child a,parent b WHERE a.parent_id=b.parent_id ORDER BY a.child_fnam

heap sort program in pl/sql

Number Types The Number types permit you to store the numeric data (real numbers, integers, and floating-point numbers), show quantities, and do computations. BINARY_INTEG

COMMIT Statement The COMMIT statement explicitly makes everlasting changes to the database during the present transaction. The Changes made to the database are not considered e

Creating a SQL file 1. Open a new file in Notepad++ and save it to the location c:\mysql\bin, with the name lab8script.sql (the file extension should be .sql ). Add a MySQL co

Assignments in pl/sql The Variables and constants are initialized every time a block or subprogram is entered. By default, the variables are initialized to NULL. Therefore, unle