Use the following data management commands to write and delete data with InfluxQL: - [Write data with INSERT](#write-data-with-insert) - [Delete series with DELETE](#delete-series-with-delete) - [Delete measurements with DROP MEASUREMENT](#delete-measurements-with-drop-measurement) ## Write data with INSERT The `INSERT` statement writes [line protocol](/influxdb/version/reference/syntax/line-protocol/) to a database and retention policy. ### Syntax ```sql INSERT [INTO [.]] ``` - The `INTO` clause is optional. If the command does not include `INTO`, you must specify the database with `USE ` when using the [InfluxQL shell](/influxdb/version/tools/influxql-shell/) or with the `db` query string parameter in the [InfluxDB 1.x compatibility API](/influxdb/version/reference/api/influxdb-1x/) request. ### Examples - [Insert data into the a specific database and retention policy](#insert-data-into-the-a-specific-database-and-retention-policy) - [Insert data into the a the default retention policy of a database](#insert-data-into-the-a-the-default-retention-policy-of-a-database) - [Insert data into the currently used database](#insert-data-into-the-currently-used-database) #### Insert data into the a specific database and retention policy ```sql INSERT INTO mydb.myrp example-m,tag1=value1 field1=1i 1640995200000000000 ``` #### Insert data into the a the default retention policy of a database ```sql INSERT INTO mydb example-m,tag1=value1 field1=1i 1640995200000000000 ``` #### Insert data into the currently used database The following example uses the [InfluxQL shell](/influxdb/version/tools/influxql-shell). ```sql > USE mydb > INSERT example-m,tag1=value1 field1=1i 1640995200000000000 ``` ## Delete series with DELETE The `DELETE` statement deletes all points from a [series](/influxdb/version/reference/glossary/#series) in a database. ### Syntax ```sql DELETE FROM WHERE [=''] | [