O'Reilly logo

Getting Started with MariaDB by Daniel Bartholomew

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

Selecting, inserting, updating, and deleting data

Getting data into and out of our database tables and updating, and deleting data when necessary is where we will spend most of our time when working with MariaDB.

Inserting data

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

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

As with the CREATE TABLE command, the parts in angle brackets (<>) are what we'll replace with our own values. The square brackets ([]) are optional and the pipe character (|) means or. The curly brackets ({}) specify a section that is mandatory but for this there is a choice of the key word you can use. For example, ...

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