Adding a new column to an existing table in BigQuery is a common task when evolving your data schema. BigQuery allows schema updates like adding new columns without requiring a full table rewrite.
You can use the ALTER TABLE statement to add a new column. For example, to add a new column named 'new_column_name' with data type STRING to a table, you can execute: ALTER TABLE `my_project.my_dataset.my_table` ADD COLUMN new_column_name STRING;
To demonstrate, you can create an employee table with columns like employee_id, first_name, last_name, email, hire_date, and department. Afterward, you can add a new column 'salary' of type DOUBLE to the employee table using ALTER statement.
Alternatively, you can also add a new column by using the 'Edit schema' option in the BigQuery UI. Simply click on 'Add field', provide the field name, type, Mode, and description, and then save the changes to reflect the new column in the table schema.