How to Alter MySQL Database Table using MySQL Workbench? mytestdb, the ‘Tables’ link will contain the newly created students table as shown in the below image. Now under the SCHEMAS menu, under the selected database i.e. Here, simply click on the Apply button as shown in the below image to execute the SQL Statements.Īnd from the next window, click on the Finish to save the changes as shown in the below image. Once you click on the Apply button, it will open the below Apply SQL Script to Database window. ![]() Then click on the Apply button as shown in the below image to save the changes. Class, DataType VARCHAR(20), ‘NN’ for not null, and finally Age column which will be an unsigned INTEGER. LastName, DataType VARCHAR(20), ‘NN’ for not null, Enter another column name i.e. Default/Expression: In the ‘Default/Expression’ option, we can store a default value for the column.Įnter the second column name FirstName, DataType VARCHAR(20), ‘NN’ for not null.G: This ‘G’ option is for ‘Generated Columns’ for advanced use like expression caching, provide join index for nonrelational data, etc.We are not going to manually enter each ‘StudentId’, so we will let the system auto-generate and increment the StudentIds. ![]() We will be storing all the positive values in our ‘StudentId’ column, so we will select the ‘unsinged’ option. This option is only used for a number that stores either positive or negative values.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |