✏️ Explanatory Question

How to Add a Column

👁 4 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation

Existing Table for the question


  CREATE TABLE Human(
     ID   INT              NOT NULL,
     FIRST_NAME VARCHAR (20)     NOT NULL,
     LAST_NAME VARCHAR (20)     NOT NULL,
     AGE  INT              NOT NULL,
     ADDRESS  CHAR (25) ,
     SALARY   DECIMAL (18, 2)
  );

Question:
Which SQL statement is used to add a new EMAIL column to the existing Human table?

Answer:

ALTER TABLE Human
ADD EMAIL VARCHAR(100);

The ALTER TABLE statement is used to modify the structure of an existing table. The ADD clause adds a new column to the table. In this example, an EMAIL column of type VARCHAR(100) is added to the Human table.