# Tables

A database table is a structure that organizes data into rows and columns. Data in a table is stored in a cell that is an intersection of a vertical column and horizontal row. The table has a specified number of columns, but can have any number of rows. With IntelliJ IDEA, you can perform data manipulation and data definition operations with tables.

[Video](https://www.youtube.com/v/hEg40WdXsDg)

In IntelliJ IDEA, you can work with a table in [data editor](data-editor-and-viewer.html). When you double-click a table in the    Database   tool window  ( `View  | Tool Windows |  Database` ) , the table is opened in the Table [viewing mode](data-editor-and-viewer.html#data_view_modes_list) of data editor.

> **Note:**
> Database table  data is   available only with the Ultimate subscription.  Without the subscription, double-click opens the table  DDL definition.

Tables (   ![Table](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.table.svg)          ) can be found in the   Database   tool window   .

* For the reference on other node and object icons, refer to the [Data sources and their elements](database-tool-window.html#icons-for-data-sources-and-their-elements) chapter of [Database tool window](database-tool-window.html) topic.

* For the table column icons, refer to the [Possible icon combinations for columns](database-tool-window.html#possible-icon-combinations-for-columns) chapter.

* Hide, sort, filter, and group tree objects using the tree objects view options in the [View Options](database-tool-window.html#view_options) menu.

![Tables in Database](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database_object_table.png)

In IntelliJ IDEA, each table opens in a separate tab. The following rules are applied to long tab titles:

* The Always show qualified names for database objects option is now turned off by default. Tab names for objects are qualified if you open two tabs of objects with the same name. For example, if you open two `actor` tables from different schemas, the schema name is added in the tab name.

* If the data source has a name that is longer than 20 symbols, the name is truncated.

* If you have only one data source, IntelliJ IDEA does not display the data source name in the tab name.

* If a qualified object name has more than 36 symbols, it is truncated.

![Working with tables](https://resources.jetbrains.com.cn/help/img/idea/2026.2/working_with_tables.png)

## Create

Procedure:

1. In the   Database   tool window ,    expand the data source tree until the nodes of   databases or schemas  .

2. Right-click the      database or schema    node and select `New |   Table` .

3. In the  Create dialog that opens, enter the name of your table in the Name field.

4. Specify table settings (columns, keys, indexes, foreign keys, grants).

5. In the Preview pane, you can view and change the generated SQL code.

6. Click OK to  add your table    .

![Create a new table](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_create_new_table.png)

## Delete

Procedure:

1. Right-click a table and select `Object Actions | Drop…`. Alternatively, press `Delete` (Windows), `⌦` (macOS), `⌦` (IntelliJ IDEA Classic (macOS)), `⌦` (macOS System Shortcuts), `Delete` (XWin), `Delete` (GNOME), `Delete` (KDE), `Delete` (Emacs), `Delete` (Sublime Text), `⌦` (Sublime Text (macOS)), `Delete` (NetBeans), `Delete` (Visual Studio), `⌦` (Visual Studio (macOS)), `Delete` (Eclipse), `⌦` (Eclipse (macOS)).

2. Click OK to    save your changes and close the dialog  .

For more information about the dialog options, refer to [Confirm Drop dialog](confirm-drop-dialog.html).

![Drop a table](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_confirm_drop_dialog.png)

> **Tip:**
> Use the Qualify objects with schema names option if you want to compose the `DROP` statement and use it later. If you plan to execute the `DROP` statement right away, ignore this option as the table has already been identified.

## Modify

Procedure: Modify a table

Starting with IntelliJ IDEA 2022.1, you can change database-specific parameters of a table. The IDE generates fields for the Modify dialog automatically according to the properties received during the introspection. For example, by using this dialog in PostgreSQL, you can add and edit column check constraints.

1. In the   Database   tool window ,  right-click a table and select Modify Table.

2. In the Modify dialog, specify object settings that you need.

> **Note:**
> Column settings depend on the database vendor. For example, the Auto Increment checkbox is only available for SQLite, MySQL, and other vendors that allow it for a primary key column of an integer data type.

3. Click OK to   save your changes   .

![Modify a table](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_modify_table.png)

Procedure: Inspect same family objects in a table

1. In the   Database   tool window ,  right-click a table and select Modify Table.

2. In the Modify dialog, double-click the family node.

![Table with similar database objects in a family node of a Modify dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/similar_objects_table_in_family_nodes.png)

Procedure: Enable read-only mode for a table

To protect a table from accidental modifications in the data editor, you can make the table read-only.

* To enable read-only mode, click the Click to toggle the read-only attribute icon (![The Click to toggle the read-only attribute icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.locked.svg)) in the lower-right corner of the editor.

To turn off read-only mode, click the Click to toggle the read-only attribute icon again.

![Enable the read-only mode for a table](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_enable_read_only_mode_for_table.png)

> **Note:**
> Tables with the read-only status in the data editor can still be modified when using the query consoles or in the   Database   tool window .

### Productivity tips

Procedure: Modify a table from the data editor

You can modify a table while you edit table data.

1. Double-click a table to open it in the data editor.

2. Press `Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `Ctrl+F6` (NetBeans), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS)).

3. Modify data and click OK.

4. Press `Ctrl+F5` (Windows), `⌘ R` (macOS), `⌃ F5` (IntelliJ IDEA Classic (macOS)), `⌘ R` (macOS System Shortcuts), `Ctrl+F5` (XWin), `Ctrl+F5` (GNOME), `Ctrl+5` (KDE), `Ctrl+F5` (Emacs), `Ctrl+F5` (Sublime Text), `⌘ R` (Sublime Text (macOS)), `Ctrl+F5` (NetBeans), `Ctrl+Alt+R` (Visual Studio), `⌘ ⌥ R` (Visual Studio (macOS)), `Ctrl+F5` (Eclipse), `Ctrl+F5` (Eclipse (macOS)) to reload the page.

## Copy

You can duplicate the table data in the current schema or copy it to another schema or data source.

Procedure: Copy table data

* Drag a table to the node in which you want to create a copy. In the Import <table_name> Table dialog, ensure that mappings are correct and click Import.

[Video](https://resources.jetbrains.com.cn/help/img/idea/2026.2/create_table_copy_by_dragging.mp4)

* Right-click a table and select `Import/Export | Copy Table to…` (`F5` (Windows), `F5` (macOS), `F5` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ Y` (macOS System Shortcuts), `F5` (XWin), `F5` (GNOME), `F5` (KDE), `F5` (Emacs), `F5` (Sublime Text), `F5` (Sublime Text (macOS)), `F5` (NetBeans), `F5` (Visual Studio), `F5` (Visual Studio (macOS)), `F5` (Eclipse), `F5` (Eclipse (macOS))). In the Import <table_name> Table dialog, select the schema in which you want to create a copy, ensure that mappings are correct, and click Import.

![Create a table copy using context menu](https://resources.jetbrains.com.cn/help/img/idea/2026.2/create_table_copy_context_menu.png)

* In the [data editor](data-editor-and-viewer.html), click the Copy to Database… icon (![Copy to Database](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.upload.svg)) and select a schema to which you want to copy the table.

Check [the video at
youtube.com](https://www.youtube.com/watch?v=U5SOD-eeK50&t=1374s) to see the live example.

![Create a table copy using data editor toolbar](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_create_table_copy_toolbar_copy_to_database.png)

Procedure: Copy table structure

* You can copy the table structure using SQL Generator. To do that, in the   Database   tool window  ( `View  | Tool Windows |  Database` ), right-click the table and select `SQL Scripts | SQL Generator…`. Alternatively, press .

For more information about the SQL Generator… controls, refer to [Generate DDL definitions for database objects](export-data.html#generate-ddl-definitions-for-dat).

![Copy table structure](https://resources.jetbrains.com.cn/help/img/idea/2026.2/copy_table_structure.png)

## Quick documentation

[Quick documentation](viewing-reference-information.html#inline-quick-documentation)   (`Ctrl+Q` (Windows), `F1` (macOS), `⌃ J` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Ctrl+Q` (XWin), `Ctrl+Q` (GNOME), `Ctrl+Q` (KDE), `Ctrl+Q` (Emacs), `Ctrl+Q` (Sublime Text), `Ctrl+Q` (Sublime Text (macOS)), `Ctrl+Q` (NetBeans), `Ctrl+K, I` (Visual Studio), `⌘ K, I` (Visual Studio (macOS)), `Alt+Middle-Click` (Eclipse), `⌥ Middle-Click` (Eclipse (macOS))) displays information about a table: data source, database, schema, name, auto-generated definition, and table preview. To see the table preview, click Show table preview.

* In the editor: ![Table information in Quick Documentation popup in the editor](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_quick_doc_table_preview_in_editor.png)

* In Database tool window : ![Table information in Quick Documentation popup in the Database tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/quick_doc_table_preview.png)

For PostgreSQL and MySQL databases, table preview also contains information about the table size.

### Reference

[Data editor and viewer](data-editor-and-viewer.html#reference)  [Create and Modify dialog](create-and-modify-dialogs.html#table_structure_editor)     [Possible icon combinations for columns](database-tool-window.html#possible-icon-combinations-for-columns) [Data sources and their elements](database-tool-window.html#icons-for-data-sources-and-their-elements) [Import Table dialog](import-data.html#import_dialogs)

### Related

[View data](tables-view-data.html)

### Tool Windows

[Database tool window](database-tool-window.html)

### Navigation

### Language and Framework-Specific Guidelines

[Database Tools and SQL](relational-databases.html)

