O'Reilly logo

Beginning C# 5.0 Databases, Second Edition by Vidya Vrat Agarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required