Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The generic term for a <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code> and <code>MERGE</code> is an "update" (even though it is potentially confusing -- and not ideal -- that <code>UPDATE</code> is merely a subset of "update"). An alternative term is "relational assignment".</p> <p>The generic term for <code>SELECT</code>, <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code>, <code>MERGE</code> (and anything else terminated by a semicolon) is known as a "statement".</p> <p>Strictly speaking, a "query" is a <code>SELECT</code> statement that returns a resultset (which would for example preclude <code>SELECT..INTO..FROM</code> statements). However, using the term "query" to refer to an update, while informal, is unfortunately very common. For example, although "update query" is an oxymoron, when I do a Google search for this site using that exact term (<code>site:stackoverflow.com "update query"</code>) I get 17,300 hits! </p> <hr> <p>UPDATE (pun indended :) </p> <blockquote> <p>@David Marx: I disagree with your claim that it's appropriate to refer to INSERT/DELETE/MERGE as an 'update.' That would be extremely confusing. Only UPDATE is an update.</p> </blockquote> <p>I agreed in my original answer that the situation is potentially confusing. We are fortunate on Stackoverflow to be able to format answers and comments so that a keyword <code>UPDATE</code> can be differentiated from a logical update; writing keywords in upper case (as required by Full Standard SQL-92 :) also helps.</p> <p>However, from reading the general database and computing science literature, I can tell you that 'update' is indeed the correct collective term. I below provide a citation for this:</p> <p>"An Introduction to Relational Database Theory" (2010), Hugh Darwen [available as a free pdf download -- Google it):</p> <blockquote> <p>The different update operators expected in a relational DBMS are usually called <code>INSERT</code>, <code>DELETE</code> and <code>UPDATE</code>, and those are the names used in Tutorial D (also in SQL) [p.28]</p> <p>It is regrettable that the keyword <code>UPDATE</code> has become so widely accepted as the name of just one particular operator for updating databases. Please don't shoot the messenger! [p.168]</p> <p>although [relational] assignment is theoretically sufficient for updating purposes, it is usually more convenient to use a shorthand expressing the difference between the current value of the target relvar and the new value. Sometimes... that difference is just the addition of one or more tuples to the existing set; sometimes it is just changes to some of the attribute values of some of the existing tuples; and sometimes it is just the removal of some of the existing tuples. Shorthands for those three particular cases have been referred to as <code>INSERT</code>, <code>UPDATE</code> and <code>DELETE</code> respectively, since time immemorial -- in other words, even before the advent of relational databases, though of course before that advent the targets of the updates were files, not relvars or SQL tables [p.165]</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload