# 1.2.2.2.Creating a Table - CREATE TABLE

* 建立table
  * 欄位:
    * id: Type, 長度, [auto increment](https://www.fooish.com/sql/auto-increment.html), [primary key](http://www.w3school.com.cn/sql/sql_primarykey.asp)
    * 其他欄位: not null

      ```
      create table StudentsDetails (id INT(11) auto_increment primary key, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, email VARCHAR(100), mobile VARCHAR(100), enrolled_date TIMESTAMP);
      ```

      ![](https://1088158622-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G87SQJ28mvsXOhL%2F-M4M0IBPb1goOGpuG1BI%2F-M4M0Kuqkjj--r-zq_mC%2F201804142.jpg?generation=1586302925350092\&alt=media)
