![]() |
![]() ![]() ![]() |
|
Learn the basics of SQL's four main data manipulation statements: INSERT, SELECT, UPDATE, and DELETE. By Gabrielle Gagnon Fluency in SQL is a valuable asset to anyone who uses a database. In this article, the second half of a two-part primer on SQL, we walk you through four fundamental data manipulation statements--the heart of SQL's functionality--introducing you to comparison operators, selection predicates, and three-valued logic along the way. When you've completed this primer, you will be on your way to becoming a SQL master. In our previous issue, we concluded by creating a table using the CREATE TABLE statement, an example of a category of SQL statements called data definition language (DDL) statements. DDL statements define database objects such as tables, columns, and views. They don't deal with rows in a table, however, because DDL statements don't handle the actual data that goes into a database. There is another category of SQL statements for doing that: data manipulation language (DML) statements. There are four basic DML operations in SQL: INSERT, SELECT, UPDATE, and DELETE. Since these are the statements that most SQL users will work with, we'll cover all of them here. In Figure 1, we show a table called EMPLOYEES. Each row corresponds to a specific employee record. Take some time to familiarize yourself with this table; we'll be using it for the rest of our examples. Gabrielle Gagnon is a freelance programmer and technical writer. FIGURE 1: This SQL table was created with the CREATE TABLE statement. Each row corresponds to an employee record. Table 1
Next: The INSERT statement Published as PC Tech Feature in the 11/17/98 issue of PC Magazine.
Elsewhere on ZDNet
|
|
TOP | ![]() Copyright (c) 1998 Ziff-Davis Inc. |