Get the App
SLTechnology News&Howtos  ›  Database  › 

Command line for MySQL to create a datasheet

Shulou Source: shulou.com Published: 2022-06-01 13:44:35 09月30日 Update

In MySQL, you need to create a database first, and then create a data table. To create a data table, you must first design the fields of the data table, which are numeric type, text type, floating point type, string type, date type, and so on.

1, create the data table command line CREATE TABLE table_name2, create the structure of the data table CREATE TABLE dc3688 (

Id INT (11) NOT NULL AUTO_INCREMENT

Subject VARCHAR (45) DEFAULT NULL

Start_date DATE DEFAULT NULL

End_date DATE DEFAULT NULL

Description VARCHAR (200) DEFAULT NULL

PRIMARY KEY (id)

) ENGINE=InnoDB

Create a data table as 3688 table, field id,subject,start_date,end_date,description

PRIMARY KEY sets the primary key, and ENGINE=InnoDB table engine is ENGINE=InnoDB

Int (11) is a number

Not null is not empty

Automatic growth of AUTO_INCREMENT

The article is from http://www.dc3688.com/.

Tags: Data datasheet type field number command character string engine database text article date floating point structure design Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL MariaDB OPPO Reno Xiaomi Apple