# File management

Procedure: Enable the Database Tools and SQL plugin

This functionality relies on the  Database Tools and SQL plugin, which  is bundled and enabled in IntelliJ IDEA   by default. If the relevant features are not available, make sure that you did not disable the plugin.

> **Note:**
> Database Tools and SQL functionality support is limited in IntelliJ IDEA without the Ultimate subscription.

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Plugins`.

2. Open the Installed tab, find the Database Tools and SQL plugin, and select the checkbox next to the plugin name.

To run your statements and keep track of your code ideas, use  the Database Tools and SQL plugin's special file types. You can also work with the files that you store on your machine, and edit the DDL of database objects in the IntelliJ IDEA internal files.

* Query files are SQL and JS files that you can create for a data source in the IDE and store them in an IDE project. In query files, you can write, run, and store your SQL statements. A query file is included in the project context if you choose to store it in the [current project directory](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html). For more information about query files, refer to [Query files](query-files.html).

* Query consoles are SQL and JS files are created for a data source automatically, always attached to it, and stored outside an IDE project. You can write and execute SQL statements in query consoles the same way as you do it in terminal. Query consoles are not included in the project context. Query consoles are located in the `Scratches and Consoles | Database Consoles` internal directory . For more information about query consoles, refer to [Query consoles](query-consoles.html).

* Scratch files are similar to query consoles, but they are not attached to a data source. We refer to scratch files as temporary notes or drafts for code ideas. Usually, scratch files are outside of the project context. But you can associate an SQL scratch file with a data source and use it as an SQL editor. For more information about scratch files, refer to [Scratch files](scratches.html).

* User files are SQL scripts that you store on your computer or on a server. For more information about working with directories and user files, refer to [User files](working-with-user-files.html).

* Object editors are internal files where you edit the DDL of a procedure, a view, a function, or other objects.

|  | Context | Functionality |
| --- | --- | --- |
| Query files | Files that can be attached to a data source and detached from it. |      * Can be stored in an IDE project and associated with it, can also be stored outside a project.    * Query files can be attached to a data source.    * Can be put under [Version Control](version-control-integration.html).    * Default resolve mode is [Playground](query-consoles.html).    |
| Query consoles | SQL files that are attached to a specific data source. |      * Files that you can use to compose and execute SQL statements in the project context.    * Query consoles are attached to a data source.    * Default resolve mode is [Playground](query-consoles.html).    |
| Scratches | Files that are not attached to a specific data source. |   * Temporary notes or drafts for your code outside the project context.    * By default, scratch files are not attached to a data source.    * Default resolve mode is [Script](query-consoles.html).   |
| User files | Files that are stored on your machine. |   * Can be opened from different projects.    * Can be put under [Version Control](version-control-integration.html).    * By default, user files are not attached to a data source.    * Default resolve mode is [Script](query-consoles.html).   |

> **Tip:**
> To execute statements from a scratch file or a user file, select a data source from the <data source> list.

> **Tip:**
> To have a correct resolve in user files, map the files to any [resolution scope](settings-languages-sql-resolution-scopes.html) in `Settings | Database | SQL Resolution Scopes`.

