CBSE Class 12 Informatics Practices
Question 31 of 79
MySQL SQL Revision Tour — Question 24
Back to all questionsThe ALTER TABLE command is used to change definitions of existing tables. It is used to add columns, integrity constraints and redefine a column (datatype, size, default value) in a table.
Yes, we can add new columns with constraints such as NOT NULL, which ensures that a column must always contain a value (i.e., cannot be empty or null).
For example, to add a new column tel_number with the NOT NULL constraint in the Empl table, the statement is:
ALTER TABLE Empl
ADD COLUMN(tel_number integer NOT NULL);