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