System information

34 Chapter 3: Database Fundamentals
About SQL
SQL (Structured Query Language) is a language that lets you communicate with databases. For
example, you can use SQL to retrieve data from a database, add data to a database, delete or
update records in a database, change columns in multiple rows, add columns to tables, and add
and delete tables.
Unlike other computer languages, SQL is made up of a small number of language elements that
let you interact efficiently with a database. Some of the more frequently used elements include the
following SQL commands:
Understanding basic SQL SELECT statements
One of the most widely used SQL statements is the SELECT statement. The SQL SELECT
statement retrieves columns of data from a database. The tabular result is stored in a result table
(called the record set).
You use the following SELECT statement to retrieve information from a table:
SELECT column_name(s) FROM table_name
Consider a table named Clients that contains the following rows:
To select the columns named LastName and FirstName, use the following SELECT statement:
SELECT LastName, FirstName FROM Clients
The result of this SQL statement contains the following data:
Command Use
SELECT Retrieve (query) information in a database.
INSERT Add records to a database.
UPDATE Update information in a database.
DELETE Delete information in a database.
LastName FirstName Address City
Brown Marie 12 State St Boston
Adams Russell 521 Beacon St Boston
Carter Joan 1 Broadway New York
LastName FirstName
Brown Marie
Adams Russell
Carter Joan