Jump to content

Talk:Update (SQL)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by TinucherianBot (talk | contribs) at 12:03, 26 September 2008 (Autoassessment for WP:COMP : ( FAQ ) : (Plugin++) class=Stub, auto=yes.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputing Stub‑class
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StubThis article has been rated as Stub-class on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.
Note icon
This article has been automatically rated by a bot or other tool as Stub-class because it uses a stub template. Please ensure the assessment is correct before removing the |auto= parameter.
WikiProject iconDatabases (inactive)
WikiProject iconThis article is within the scope of WikiProject Databases, a project which is currently considered to be inactive.

Maybe the article does not reflect typical syntax from real databases. For example, this is valid in Microsoft SQL server:

UPDATE authors
SET state = 'ZZ' 
FROM (SELECT TOP 10 * FROM authors ORDER BY au_lname) AS t1
WHERE authors.au_id = t1.au_id

More info here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ua-uz_82n9.asp

This syntax would need quite a bit of explanation. In my view, it is not intuitive at all. What makes more sense is this:
UPDATE ( SELECT * FROM authors WHERE ... ) AS t1
SET    state = 'ZZ'
Here it is clear that the query determines the rows to be updated. SQL Server's syntax is not clear in this respect. I would propose to add such highly product-specific things here: Comparison of SQL syntax --Stolze 18:52, 6 November 2006 (UTC)[reply]

The problem with ignoring the MS and Sybase syntax is for complex update queries having to manually correlate both the set and where clause of the query quickly becomes a maintenance and readability hazard.

I agree that correlating both is not so easy. But I fail to see how the above MS-specific example helps in this regard. Reading this statement gives: Update the table "authors", set the values in column "state" to 'ZZ', from ...how to fit this into the sentence???..., and finally filter the rows on some predicate in the where clause. --Stolze 01:15, 22 April 2007 (UTC)[reply]

Merge

Recommend merging UPDATE, INSERT, DELETE, MERGE and SELECT statements into DML article and redirecting these statements there. Comments? SqlPac 05:17, 17 May 2007 (UTC)[reply]

POLICY DEBATE: Use of source code and other examples in articles

Someone started a policy debate concerning the use of source code in articles, that seems to directly impact this (and possibly other Database articles). See below for details:

I have opened a debate on the use of source code and other examples in Wikipedia articles. It seems that many pieces of example source code etc. currently in Wikipedia violate Wikipedia policy, so we need to either clarify or change the situation. Depending on the result of the discussion, this may result in a number of source code examples being summarily removed from computing articles!

Please reply there, not here, if you wish to contribute.—greenrd 10:50, 18 May 2007 (UTC)[reply]

Thanks.SqlPac 15:09, 18 May 2007 (UTC)[reply]

Human-Readible

The latest revision of this page contains syntax like "UPDATE T SET C1 = 1 WHERE C2 = 'a'" - could someone replace this with real-life, or human-readible examples? IMHO it is very difficult to interpret such abstract concepts, especially as a page such as this should be a very simple concept. --78.33.32.231 (talk) 14:32, 17 July 2008 (UTC)[reply]