Saturday, March 02, 2019

mySql Common Commands




CREATE TABLE foo LIKE bar;
 
 
 
CREATE TABLE IF NOT EXISTS offices_bk
SELECT * FROM
    offices;
==
CREATE TABLE IF NOT EXISTS new_table LIKE existing_table;
INSERT new_table
SELECT * FROM existing_table;
ALTER TABLE <tablename> CHANGE COLUMN <colname> <colname> VARCHAR(65536);
 
 
 
ALTER TABLE emp MODIFY COLUMN name VARCHAR(100);

Or use CHANGE, but that means you have to give the column name twice (because CHANGE allows you to change the name of the column too).
ALTER TABLE emp CHANGE COLUMN name name VARCHAR(100);

 
 

No comments:

Running apps

Runtastic (I uninstalled because force to update your device - Internet connection problems) Runkeeper  (Wrong GPS tracking) Strava   (Curr...