Create a table in a database with SQL
When you create a table in a database, you can use the tools with a graphical interface, such as phpMyAdmin for MySQL database, or Microsoft ACCESS. But sometimes it's useful to create a table using SQL statements.
The following code example creates the table customers:
CREATE TABLE customers(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT ,
surname VARCHAR( 30 ) ,
name VARCHAR( 30 ) ,
company VARCHAR( 30 )
)