Joe Celko's SQL for Smarties: Advanced SQL Programming, Third Edition

Chapter 8: Table Operations

Overview

There are only four things you can do with a set of rows in an SQL table: insert them into a table, delete them from a table, update the values in them, or query them. The unit of work is a set of whole rows inside a base table.

When you worked with file systems, access was one record at a time, then one field within a record. Since you had repeated groups and other forms of variant records, you could change the structure of each record in the file.

The mental mode in SQL is that you grab a subset as a unit, all at once, in a base table and insert, update, or delete as a unit, all at once. Imagine that you have enough computer power that you can allocate one processor to every row in a table. When you blow your whistle, all the processors do their work in parallel.

8.1 DELETE FROM Statement

The DELETE FROM statement in SQL removes zero or more rows of one table. Interactive SQL tools will tell the user how many rows were affected by an update operation, and Standard SQL requires the database engine to raise a completion condition of "no data" if there are zero rows. There are two forms of DELETE FROM in SQL: positioned and searched. The positioned deletion is done with cursors; the searched deletion uses a

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Order Picking Systems
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.