Skip to Main Content
SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, Second Edition
book

SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, Second Edition

by John L. Viescas, Michael J. Hernandez
September 2007
Intermediate to advanced content levelIntermediate to advanced
672 pages
13h 23m
English
Addison-Wesley Professional
Content preview from SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, Second Edition

The INSERT Statement

SQL has two main versions of the INSERT statement. In the first version, you include the VALUES keyword and list the values that you want your database system to add as a single new row in a specified target table. The second version lets you use a SELECT clause to fetch data from a table to insert into your target table. Let’s take a look at the VALUES version first.

Inserting Values

Although SQL is primarily designed to work with sets of data, much of the time you’ll use INSERT to add a single row of data to one of your tables. The simplest way to add one row to a table is to use the INSERT statement with the VALUES clause. Figure 16-1 shows the diagram for this statement.

Figure 16-1. The syntax diagram of the INSERT ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL Queries for Mere Mortals®: A Hands-On Guide to Data Manipulation in SQL, Third Edition

SQL Queries for Mere Mortals®: A Hands-On Guide to Data Manipulation in SQL, Third Edition

John Viescas, Michael J. Hernandez
Effective SQL: 61 Specific Ways to Write Better SQL, First Edition

Effective SQL: 61 Specific Ways to Write Better SQL, First Edition

John L. Viescas, Douglas J. Steele, Ben G. Clothier
SQL for Data Analytics

SQL for Data Analytics

Upom Malik, Matt Goldwasser, Benjamin Johnston

Publisher Resources

ISBN: 9780321444431Purchase book