Create DATABASE DD; Establish DD Database
Create database ' databases ' to build
Drop DATABASE DD; Delete DD Database
CREATE Table D1 (
ID Decimal (3,2) 3-bit character contains 2-bit decimal point
Primary KEY (ID)
) Engine=myisam auto_increment=5 default Charset=utf8; Atuo_increment represents self-increment
Insert into D1 values (3); Insert information into the database
SELECT * from D1; Query the information in the D1 table
Sid varchar (20),
Sgeneder enum (' Male ', ' female ', ' secret '),
ID Int (6) Unsigend Zerofill NOT NULL auto_increment,
--View the code that establishes the database command
Show create database db;
Integral type can only store decimals
tinyint
Mediumint
smallint
Shortint
Int
Integer
Precision types can retain decimals
Decimal (P,s)
Date type
Date
Date Time Type
Datetime
Fixed string
CHAR (n)
Variable length string
VARCHAR (n)
Variable-length text type
Text
Large text type, 0-4g characters
Longtext
Enum type enum (' Male ', ' female ', ' confidential ')
Enum
DROP TABLE DD; --Delete Table
MySQL Basic operation 1