Skip to content

Tables and columns

Right-click a table and choose Open Structure, or right-click a database and choose + New table to create one.

The structure tabs

TabContents
ColumnsName, type, nullable, primary key, default, comment, auto increment, collation, on update, extra
IndexesName, columns, unique flag, index type
Foreign keysConstraints referencing other tables
SQLThe CREATE TABLE statement
OptionsEngine, character set and other table-level options

Editing columns

You can add a column, drop one, change an existing one's definition, and set the primary key. Each change is turned into the matching ALTER TABLE statement.

Changing a column type rewrites data

Narrowing a type — varchar(255) to varchar(50), bigint to int — can truncate or reject existing values, and on a large table the operation may lock it for a while. Check the SQL tab and try it on a copy first. Duplicate in the table right-click menu gives you that copy.

Indexes

Add an index over one or more columns and mark it unique when the data requires it. Indexes speed up reads and slow down writes; add them because a query needs one, and confirm with the profiler that the query actually uses it.

Table operations

From the right-click menu on a table:

ActionWhat happens
Rename TableAsks for the new name
Copy TableCopies it to the clipboard, to be pasted into another database on the same connection
DuplicateCreates a copy in the same database
Import into tableOpens the import wizard
Dump SQL file ▸Structure and data, or structure only
Truncate (reset AI)Deletes all rows and resets auto-increment
Empty (DELETE FROM)Deletes all rows, keeps the auto-increment counter
Drop TableRemoves the table entirely

The last three ask for confirmation and name the table in the question. Truncate and empty differ only in the counter — if the next row must continue from the old numbering, use Empty.

Select several tables and the menu offers Drop N tables. On the Tables group node you can copy all tables at once, paste a copied table, or drop them all.

Copying tables between databases

Copy Table then Paste Table on the target database works within one connection. Across connections — or across engines — use Data transfer, which handles the type differences.