alter table in mysql code example

Example 1: sql add column

ALTER TABLE Customers
ADD Email varchar(255);

Example 2: add column in mysq

ALTER TABLE Table_name
ADD Email varchar(255);

Example 3: alter table add column

ALTER TABLE table
ADD COLUMN column VARCHAR (255) NOT NULL AFTER column;

Example 4: create table in mysql

# updated dec 2020
# Creates a Simple User table
# Uses an auto-incrementing primary key as userId 

CREATE TABLE user (
    userId INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(100),
    password VARCHAR(100) 
) ENGINE=InnoDB;

Example 5: alter table add column

ALTER TABLE table_name 
ADD column_name datatype;

Example 6: mysql alter table add column

ALTER TABLE table
  ADD [COLUMN] column_name column_definition
  [FIRST|AFTER existing_column];

Tags:

Sql Example