Update command- sql, PL-SQL Programming

UPDATE Command- SQL

Loosely speaking, UPDATE changes some of the column values of some existing rows of its target table. Thus, although some rows disappear from the target and others arrive in it, so to speak, the cardinality of the table does not change. Suppose the exam board for course C2 decides that the exam has been marked too harshly and everybody's mark is to be increased by 5. Example shows how.

Example: Adding 5 to all the marks for course C2

UPDATE EXAM_MARK SET Mark = Mark + 5

WHERE CourseId = 'C2';

The syntax is self-explanatory. The WHERE specification is optional and defaults to WHERE TRUE, meaning that the specified changes are to be applied to all existing rows in the target table. The expression Mark = Mark + 5 is a column assignment. When several column assignments are needed they are separated by commas and the semantics of multiple assignment as described in the theory book apply: the right-hand sides are all evaluated before any column assignments are performed. The same column cannot be the target or more than one assignment.

Posted Date: 1/18/2013 11:38:21 PM | Location : United States







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

Write discussion on Update command- sql
Your posts are moderated
Related Questions
Anatomy of a Table: Figure shows the terminology used in SQL to refer to parts of the structure of a table. As you can see, SQL has no official terms for its counterpa

SQL outer join SELECT * FROM IS_CALLED NATURAL LEFT JOIN IS_ENROLLED_ON Note that adding LEFT to an invocation of CROSS JOIN has no effect unless the right-hand operand

Declaring Objects: You can use the object types wherever built-in types like CHAR or NUMBER can be used. In the block below, you can declare object r of type Rational. Then, yo

LOB Types The large object (LOB) datatypes like BFILE, BLOB, CLOB, and NCLOB store the blocks of unstructured data (like graphic images, text, video clips, and sound waveforms)

Data Types in SQL SQL's concept does not differ significantly from that defined in the theory book, apart from that business concerning NULL. However, the theory book equates

Fetching with a Cursor The FETCH statements retrieve the rows in the result set one at a time. After each and every fetch, the cursor advance to the next row in the result set

THEO R Y OF CATASTROPHISM OR CATALYSM (CUVIER 1769-1832) - The world has passed thorugh several stages and at the end of each stage there was a catastrophe killing all the

Calling Constructors: The Calls to a constructor are allowed wherever the function calls are allowed. Similarly to the functions, a constructor is called as a section of an ex

Assignment of Variable - Updating a Variable Syntax: SET SN = SID ('S2'); This can obviously be read as "set the variable SN to be equal in value to SID ( 'S2' )".

TTITLE and BTITLE are commands in Pl-SQL to control report headings and footers. This Ttitle & Btitle are mainly used on creating SQL*PLUS report. Ttitle is used for toptitle headi