add two columns in sql code example

Example 1: add multiple columns to table sql

//Example
ALTER TABLE employees
  ADD last_name VARCHAR(50),
      first_name VARCHAR(40);

Example 2: sql add two values together

SELECT  ID, SUM(VALUE1 + VALUE2)
FROM    tableName
GROUP   BY ID

--or simple addition

SELECT
	ID,
	(VALUE1 + VALUE2) as AddedValues
FROM tableName

Example 3: add multiple columns to table sql

ALTER TABLE table_name
  ADD column_1 column_definition,
      column_2 column_definition,
      ...
      column_n column_definition;

Tags:

Sql Example