Book Image

Getting Started with MariaDB

By : Daniel Bartholomew
Book Image

Getting Started with MariaDB

By: Daniel Bartholomew

Overview of this book

MariaDB is a database that has become very popular in the few short years that it has been around. It does not require a big server or expensive support contract. It is also powerful enough to be the database of choice for some of the biggest and most popular websites in the world, taking full advantage of the latest computing hardware available. From installing and configuring through basic usage and maintenance, each chapter in this revised and expanded guide leads on sequentially and logically from the one before it, introducing topics in their natural order so you learn what you need, when you need it. The book is based on the latest release of MariaDB and covers all the latest features and functions. By the end of this beginner-friendly book, not only will you have a running installation of MariaDB, but you will have practical, hands-on experience in the basics of how to install, configure, administer, use, and maintain it.
Table of Contents (16 chapters)
Getting Started with MariaDB Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
MariaDB Next Steps
Index

Using UPDATE


Once our data is in a table, we're not done with it. Addresses, names, and many other types of data will change, and when data in a table needs to be updated, we use the UPDATE command. The basic syntax is as follows:

UPDATE <table_name>
    SET column_name1={expression|DEFAULT}
    [, column_name2={expression|DEFAULT}] …
    [WHERE <where_conditions>];

Unlike the INSERT command, when we are updating data, we specify the data we want to insert right after each column name.

Another difference is the inclusion of a WHERE section. The WHERE section is very important because we use it to specify the exact column or columns of data in the table that we want to change. If we omit the WHERE section, the UPDATE statements will update every instance of that column. For example, we could accidentally change every employee's phone number to the same number when all we wanted to do was to update Gordon's.

Tip

Watch out! Not including the WHERE part in an update statement will tell...