One: Simple use of MySQL
1. Today to record common SQL commands
View Gallery show databases;
view table show tables;
Enter library use library name;
Create a new library create database name;
Create a new table the CREATE table library name. Table Name (field type (width) constraint); (You can omit the library name when in the library)
eg
1 start creating the first table DB1, and view the table structure
2 Insert the first value into the table and use the command to view
3 Append a field in the DB1 table
4 Modifying the value of age
SQL statement used:
Modify table structure: Alter tables library. Table Execution Action
Execution actions include:
{add: Add, modify field type and constraint: Modify, modify field name: Change, modify table name: Rename, delete: Drop}
ALTER TABLE Add|modify|change|rename
ALTER TABLE DB1 add age int (2); [Firsh|after: Specify where to insert]
ALTER TABLE DB1 Modify field Name type (width) constraint;
ALTER TABLE DB1 change original field name New name type (immutable) constraint (variable);
ALTER TABLE DB1 Rename the name of the new table with the original table name;
ALTER TABLE DB1 drop field
Primary use of MySQL