Skip to content
Question 90 of 95

Q.Which SQL command is used to add a new attribute in a table?

Sikkim CbseCBSE Class XII Board 2020Subjective· 1mImportance★★★★★
95% · 90/95 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

To add a new column (attribute) to an existing table, use the ALTER TABLE command with the ADD clause. The syntax is ALTER TABLE table_name ADD column_name datatype;.

Why ALTER TABLE?

When you create a table using CREATE TABLE, you define its initial structure—the columns, their data types, constraints, and so on. But database schemas evolve. You might realize later that you need to store additional information: perhaps a phone number column in a customer table, or a timestamp for when records were last modified.

SQL provides the ALTER TABLE command specifically for modifying the structure of existing tables. Think of it as the "edit mode" for your table's blueprint. Among its various capabilities—renaming columns, dropping columns, changing data types—the ADD clause lets you introduce new attributes without losing any existing data.

The ADD Clause in Action

The basic syntax is straightforward:

ALTER TABLE table_name
ADD column_name datatype [constraints];

Here's what happens step by step:

  1. Identify the table: ALTER TABLE targets the specific table you want to modify.

  2. Specify the operation: The ADD keyword tells the database you're introducing a new column, not removing or changing an existing one.

  3. Define the new attribute: You provide the column name, its data type (like VARCHAR(50), INT, DATE), and optionally any constraints (NOT NULL, DEFAULT value, etc.).

  4. Execution: The database adds the column to every row. For existing rows, the new column is populated with NULL (unless you specify a DEFAULT value).

Example …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.