C H A P T E R  4

Manipulating Database Data

Now that you know how to create databases and tables, it’s time to turn your attention to modifying data, such as inserting, updating, and deleting it.

In this chapter, we’ll cover the following:

  • Inserting data
  • Updating data
  • Deleting data

Inserting Data

After creating a table, you need to be able to add data such as rows to a table. You do this by using the INSERT statement.

A basic INSERT statement has these parts:

INSERT INTO <table> (<column1>, <column2>, ..., <columnN>) VALUES (<value1>, <value2>, ..., <valueN>)

Using this syntax, let’s add a new row to the MySqlTable table of the newly created SQL2012Db database.

Try It: Inserting a New Row

To insert a new row into a table, open a New Query ...

Get Beginning C# 5.0 Databases, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.