Skip to content

Commit

Permalink
add sql docs entry (table operations)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed Feb 11, 2025
1 parent ba514a5 commit ce5cf80
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions py-polars/docs/source/reference/sql/table_operations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Table Operations
- Description
* - :ref:`CREATE TABLE <create_table>`
- Create a new table and its columns from a SQL query executed against an existing table.
* - :ref:`DELETE FROM <delete_from_table>`
- Remove specific rows of data from a table using an (optional) constraint.
* - :ref:`DROP TABLES <drop_tables>`
- Deletes the specified table, unregistering it.
* - :ref:`EXPLAIN <explain>`
Expand All @@ -34,6 +36,19 @@ Create a new table and its columns from a SQL query executed against an existing
CREATE TABLE new_table AS
SELECT * FROM existing_table WHERE value > 42
.. _delete_from_table:

DELETE
--------
Remove specific rows from a table using an (optional) constraint.
Omitting the constraint deletes all rows, equivalent to TRUNCATE.

**Example:**

.. code-block:: sql
DELETE FROM some_table WHERE value < 0
.. _drop_tables:

DROP TABLES
Expand Down

0 comments on commit ce5cf80

Please sign in to comment.