![]() The default value of the newly added columns depends on the value of the SQL mode. Let us retrieve the records in the educab_writers table and see the value for the added columns for existing records – select * from educba_writers Īll column values have a default value of NULL. Let us describe the educba_writers table once again to check whether our columns are added successfully by using the following query statement – DESC educba_writers We can write the ALTER TABLE query with ADD statement in it to add two columns in the following way – ALTER TABLE educba_writersĮxecution of the above query statement gives the following output on the command line – The datatype of the rate will be decimal with precision and scale as (5,2), and the datatype of joining_date should be DATE. We want to add two columns named rate and joining_date columns to the educba_writers table using the ALTER TABLE command. The educab_writers table consists of the following columns: DESC educba_writers ![]() The default position where the new column is added is at the last. FIRST represents that the new column will be placed in the beginning, while AFTER signifies the position of the new column after the name_of_existing_column named column in the table.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |