Chapter 6. Using MariaDB – Inserting, Updating, and Deleting

Getting data into the tables in our databases, and updating and deleting that data when necessary, is where we will spend a good portion of our time when working with MariaDB. To learn how to do this, we will be covering the following commands in this chapter:

  • Using INSERT
  • Using UPDATE
  • Using DELETE

Using INSERT

To put data into our database, we use the INSERT command. The basic syntax is as follows:

INSERT [INTO] <table_name> [(<column_name>[, <column_name>,...])]
{VALUES | VALUE}
({<expression>|DEFAULT},...)[,(...),...];

As with the CREATE TABLE command in the previous chapter, the parts of the syntax example within the angle brackets (<>) are what we'll replace with our own values. The ...

Get Getting Started with MariaDB - 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.