DataGrip 2022.2 Help

Create and delete

Create a table

  1. In the Database Explorer, select a schema and navigate to File | New | Table. Alternatively, right-click the schema or database node and select New | Table.

  2. In the Create New Table dialog, specify table settings (columns, keys, indexes, foreign keys, grants).

  3. Click OK.

    Create a table

Delete a table

  • To delete a table, right-click the table and select DROP (Delete).

    You can set additional options for the code that is generated in the SQL Preview field:

    1. Qualify objects with schema names: adds a schema name to the table name. You can qualify a table when you have two and more tables with identical names in different schemes. This option has the following parameters:

      • Auto: automatically qualifies table names if you have more than two identical table names in different schemes.

      • Never: never qualifies table names.

      • Always: always qualifies table names.

    2. Use IF EXISTS syntax: ensures that the table exists.

    3. Use DROP CASCADE syntax: deletes objects that depend on the table (such as views).

    The Confirm Drop dialog
Last modified: 22 November 2021