MySQL Conference

O’Reilly Media will be hosting the MySQL Conference in Santa Clara, California: April 12 - 15, 2010.

MySQueaL Resources

resources for mysql admins and developers who are squealing for help
site last updated:
04 mar. 2010 - 10:45:30 am


1332 hits past day

Data Manipulation Statements

This section includes SQL statements related to the manipulation of the contents of tables (e.g., SELECT, INSERT, and UPDATE).

Related SQL Statements

Below are MySQL statements related to the SQL topic selected.

INSERT

This MySQL statement is used to add rows of data to a table. It has a few primary syntax with many options.

SELECT

To retrieve and display data from tables within a database, use this MySQL statement. It also has more than one syntax and many options—it also allows for sub-queries.

REPLACE

This MySQL statement to insert new rows of data and to replace existing rows where the PRIMARY KEY or UNIQUE index key is the same as the new record being inserted.

UPDATE

If you want to change data in a table or just in some rows—even one row only—use this MySQL statement. Click on the heading here for more details.

DELETE

Use this MySQL statement to delete rows of data from a given table. Be careful with this one: there's basically no UNDO statement.

SET

This MySQL statement sets a system or user variable for global or session use.

DO

This MySQL statement suppresses the display of an expression's results. I can't think of much point to this one. Please let me know you can.

HANDLER

A handle provides direct access to a table, as opposed to working from a results set. Handles can be faster than a SELECT statement when reading large numbers of rows from a table. MyISAM and InnoDB tables currently support handlers.

LOAD DATA INFILE

This MySQL statement can be used to import organized data from a text file into a table in MySQL. The file can be either on the server or on the client.

SHOW ERRORS

Use this MySQL statement to display error messages for the previous SQL statement. It has a COUNT(*) clause that you can use to see the number of error messages generated rather than displaying them.

SHOW WARNINGS

Use this MySQL statement to display warning messages, error messages, and notes for previous SQL statements for the current session. It also has a COUNT(*) clause that you can use to see the number of error messages generated rather than displaying them.

TRUNCATE

Use this MySQL statement to delete the contents of a table rapidly. It's similar to the DELETE statement in that it will delete all of the data contained in a given table.

EXPLAIN

Use this MySQL statement to display information about the columns of a given table or the handling of a SELECT statement. It used to be similar to DESCRIBE and SHOW COLUMNS statements. Now it shows which index the statement will use and, when multiple tables are queried, the order in which the tables are used. It can be helpful in determining the cause of a slow query.

Return to previous page of our MySQL Documentation
MySQL columns: everywhere I look are tables and columns; life is filled with databases of information to be ordered and grouped. (Lecco, Italy)

special notices

Color Highlights

When you look at SQL statements and functions on the pages for some sections of our documentation for MySQL, you may notice that some are shown in a different color (light blue at the moment). What we've done is set up a log to keep track of which pages of our documentation readers view. From there, our script every few minutes determines the most popular statements and functions and changes the colors of the links to those pages.

Need Math Examples

Although we did well in math classes all through school, we have very little experience with the Math Functions of MySQL very little. As a result, we don't have very good examples for them. If you work in science or engineering and have some ideas for easy to understand examples that we can add, please tell us.