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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.