Getting Started with DataGrip - Common Operations (3)

Next, let's use DataGrip to complete common database operations, including querying data, modifying data, creating databases, tables, and more.



The upper left area shows the current database connection. After expansion, it will display information such as database tables. If there is no information after expansion, you need to select the database connection, click the rotation icon above to synchronize, and there is a More Schema option below, click to switch between different schemas .

Right-click the selected database connection, select open console, and you can write sql statements in the console on the right.


 

DataGrip's smart prompts are very cool, whether it's standard sql keywords, table names, field names, or even database-specific fields, all of them can be prompted. I have to sigh that this smart prompt is too powerful, and Intellij IDEA's smart prompts also kill eclipse in seconds. .

After writing the sql statement, you can select it and execute the green arrow on the upper left side of the electron.


 You can also use the shortcut key Ctrl+Enter. If it is selected, the sql will be executed directly. If it is not selected, if there are multiple sqls in the console, you will be prompted which sql to execute. I was used to the operation in dbvisualizer before, the cursor in dbvisualizer stays on the current sql (sql ends with a semicolon), press Ctrl+. The shortcut key will automatically execute the current sql, in fact, DataGrip can also be set, in setting->Database-General


 The default is a prompt when the statement is executed. After changing to the smallest statement, when the cursor stays on the current statement, pressing Ctrl+Enter will directly execute the current statement.

 

The execution result of the statement is displayed at the bottom


 If the width of a column is too narrow, you can click any one of the columns with the mouse, and use the shortcut keys Ctrl+Shift+left and right arrows to adjust the width. If you want to adjust the width of all columns, you can click the red box in the upper left corner, select all the rows, and use Shortcut Ctrl+Shift+Left and Right Arrow Adjustment

It is also very convenient to add rows and delete rows. The + and - buttons on the upper part can directly add rows or delete selected rows. Editing columns is also very convenient. Double-click the column to be modified, enter the modified value, and click the mouse in other parts. complete the modification


 Sometimes we want to set a field to null, not an empty string "", DataGrip also provides a gradient operation, right-click directly on the column and select set null


 For those who need to view the results in multiple windows, that is, you want the query results to be displayed in a new tab, you can click the pin tab button, and the new query will not be displayed in the current tab, but a new tab will be opened.


 

The output console next to it shows the log information of executing sql, and you can see the time of sql execution and other information.


 I asked such a hanging tool, who else! ! !

 

To create a new table is also quite simple and smart, select the database connection, click the green + sign and select table


 In the newly opened window, you can fill in the form information


 I will ask you whether you are excited to see this window! ! !

You can fill in the table name and table comment at the top, and you can click the green + sign on the right to add a column in the middle. The column type type can also be automatically completed. After clicking the message box icon on the right side of the default, you can add comments to the column, and several tabs next to it can be used. Set up indexes and foreign keys

The DDL for all these operations is displayed directly at the bottom


 I ask you if you are afraid

After the table is created, you can click the table icon in the figure below to open the table view view


 You can view table data and DDL statements

 

The design and experience of these basic functions have amazed me, and the next step is the export of data.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326689002&siteId=291194637