MySQL Basic operation 1

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.