MySQL Operation II

Source: Internet
Author: User
Tags mysql index

Special Data type table constraint table connection index trigger security DB design

Alter Table int Primary Key  altertableint auto_increment;

Special Data type enumSetTextBlobTIMESTAMPDefault ValueCreate TableUsers (IDinteger, namevarchar( -), likes enum ('Game','Sleep','film') ); showCreate TableUsers
MySQL constraints
mysql constraint common constraint check constraint (MySQL not currently supported) non-null constraint notNULLuniqueness constraint unique PRIMARY KEY constraint FOREIGN KEY constraint definition unique constraint uniqueUnique(column 1, column 2) defines a non-null constraint notNULLdefining a PRIMARY KEY constraintPrimary Key: null is not allowed and the primary key is not allowed to be deleted repeatedly:Alter TableTableNameDrop Primary KeyThe definition of primary key auto-growth Auto_increment primary key is used together in general auto-growth. Defining FOREIGN KEY constraintsconstraintOrdersid_fkForeign Key(ORDERSID)Referencesorders (ID), deleting foreign KEY constraintsAlter TableOrdersDrop Foreign KeyORDERSID_FK; Adding foreign KEY constraints

MySQL Index

Index-scoped Index-indexed index-indexed design Orcale index

MySQL Connection:

Table_reference[INNER | Cross] JOINTable_factor[join_condition]  |table_reference straight_join table_factor|Table_reference Straight_join Table_factor oncondition|Table_reference Left [OUTER] JOINtable_reference join_condition|Table_reference NATURAL[Left [OUTER]]JOINTable_factor|Table_reference Right [OUTER] JOINtable_reference join_condition|Table_reference NATURAL[Right [OUTER]]JOINTable_factor

Connection category cross Connect internal connection left Outer connection right outer connection fully connected self-connected

MySQL Operation II

Related Article

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.