MySQL Workbench Create, Alter, Drop Table

  • 8 years ago
In this video we will learn How to Create, Alter, Drop database tables using MySQL Workbench. Open MySQL Workbench and logged in to MySQL database server using 'root' username and password. Under 'schema' menu, double click to select the newly created database in my case 'mytestdb', it display the submenu under the database. The submenu contains, the tables, views, stored procedures, function stored under the selected database.

At this moment we've just created the database so there are no tables or other information stored in it. Select 'Tables' submenu, right click on it and select 'create table' option, We can also click this top menu 'create new table' icon to create a new table under the selected database. By clicking the 'create table' link or icon open a new screen to enter the database table details.

Click inside the middle window and type column name. Lets create the students table here which we saw in practical examples. Click apply button to save the changes, it opens 'SQL statement' window, and click 'apply' button to execute the statement and finish to save the changes. Now under schemas menu, under the selected database, the 'Tables' link will contain the newly created table. We can select the table name to open the table details screen. On this screen, we can modify the column name, data type and other table settings from here.

To delete the table, simply select the table name, right click on it, and select 'drop table' option. On confirmation window, select 'drop now' option to instantly delete the table from the database.

Recommended