|
1 | | -<!-- $PostgreSQL: pgsql/doc/src/sgml/dml.sgml,v 1.10 2005/01/22 22:56:35 momjian Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/dml.sgml,v 1.11 2005/03/01 23:45:00 neilc Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="dml"> |
4 | 4 | <title>Data Manipulation</title> |
|
38 | 38 | </para> |
39 | 39 |
|
40 | 40 | <para> |
41 | | - To create a new row, use the <literal>INSERT</literal> command. |
42 | | -The command requires the table name and a value for each of the |
43 | | -columns of the table. For example, consider theproductstable |
44 | | - from <xref linkend="ddl">: |
| 41 | + To create a new row, use the <xref linkend="sql-insert" |
| 42 | +xreflabel="sql-insert-title"> command. The command requires the |
| 43 | +table name and a value for each of thecolumns of thetable. For |
| 44 | +example, consider the products tablefrom <xref linkend="ddl">: |
45 | 45 | <programlisting> |
46 | 46 | CREATE TABLE products ( |
47 | 47 | product_no integer, |
@@ -98,7 +98,9 @@ INSERT INTO products DEFAULT VALUES; |
98 | 98 | To do <quote>bulk loads</quote>, that is, inserting a lot of data, |
99 | 99 | take a look at the <xref linkend="sql-copy" |
100 | 100 | endterm="sql-copy-title"> command. It is not as flexible as the |
101 | | - <command>INSERT</command> command, but is more efficient. |
| 101 | + <command>INSERT</command> command, but is more efficient. Refer to |
| 102 | + <xref linkend="populate"> for more information on improving bulk |
| 103 | + loading performance. |
102 | 104 | </para> |
103 | 105 | </tip> |
104 | 106 | </sect1> |
@@ -188,7 +190,7 @@ UPDATE products SET price = price * 1.10; |
188 | 190 |
|
189 | 191 | <para> |
190 | 192 | You can update more than one column in an |
191 | | - <literal>UPDATE</literal> command by listing more than one |
| 193 | + <command>UPDATE</command> command by listing more than one |
192 | 194 | assignment in the <literal>SET</literal> clause. For example: |
193 | 195 | <programlisting> |
194 | 196 | UPDATE mytable SET a = 5, b = 3, c = 1 WHERE a > 0; |
@@ -222,9 +224,11 @@ UPDATE mytable SET a = 5, b = 3, c = 1 WHERE a > 0; |
222 | 224 | </para> |
223 | 225 |
|
224 | 226 | <para> |
225 | | - You use the <literal>DELETE</literal> command to remove rows; the |
226 | | - syntax is very similar to the <literal>UPDATE</literal> command. |
227 | | - For instance, to remove all rows from the products table that have a price of 10, use |
| 227 | + You use the <xref linkend="sql-delete" |
| 228 | + xreflabel="sql-delete-title"> command to remove rows; the syntax is |
| 229 | + very similar to the <command>UPDATE</command> command. For |
| 230 | + instance, to remove all rows from the products table that have a |
| 231 | + price of 10, use |
228 | 232 | <programlisting> |
229 | 233 | DELETE FROM products WHERE price = 10; |
230 | 234 | </programlisting> |
|