Do you need to create a table in MySQL? We show you how to do it with a small example.
Create a Table
We will create a table with an auto-increment field that will be used as primary key, an alphanumeric field and a date field.
CREATE TABLE sample ( id_sample INT(11) NOT NULL AUTO_INCREMENT, Name VARCHAR(45) DEFAULT NULL, singup_date DATE DEFAULT NULL, PRIMARY KEY (id_sample) );
Drop a Table
If we want to remove a table we use DROP TABLE, in this case “sample” table.
DROP TABLE sample;