Java Reference
In-Depth Information
 
DELETE
The INSERT statement is used to insert data into a table, one row or record at a time.
It can also be used in combination with a SELECT statement to perform bulk inserts
of multiple selected rows from another table or tables.
The UPDATE command is used to modify the contents of individual columns within a
set of rows. The UPDATE command is normally used with a WHERE clause, which is
used to select the rows to be updated.
The DELETE command is used to delete selected rows from a table. Again, row
selection is based o n the result of an optional WHERE clause.
Data Query Language
The Data Query Language is the portion of SQL used to retrieve data from a
database in response to a query. The SELECT statement is the heart of a SQL query.
In addition to its use in returning data in a query, it can be used in combination with
other SQL commands to select data for a variety of other operations, such as
modifying specific records using the UPDATE command.
The most common way to use SELECT, however, is as the basis of data retrieval
commands, or queries, to the database. The basic form of a simple query specifies
the names of the columns to be returned and the name of the table they can be found
in. A basic SELECT command looks like this:
SELECT columnName1, columnName2,.. FROM tableName;
In addition to this specific form, where the names of all the fields you want returned
are specified in the query, SQL supports a wild-card form. In the wild-card form, an
asterisk (*) is substituted for the column list, as shown here:
SELECT * FROM tableName;
The wild card tells the database management system to return the values for all
columns.
The real power of the SELECT command comes from the use of the WHERE clause.
The WHERE clause allows you to restrict the query to return the requested fields from
only records that match some specific criteria. For example, you can query the
Customers Table shown in Table 1 -2 by using this statement:
SELECT * FROM Contact_Info WHERE Last_Name = 'Corleone';
Search WWH ::




Custom Search