Cloud computing learning route source framework notes: Mysql source code three
The following is the notes on the cloud computing learning route source framework, and the following is about the third part of the Mysql source code:
Table operation
Create a tabl
Mysql > create tables table name (field type (modifier))
View tabl
View all tables: mysql > show tables
View table records: mysql > show table status like 'table name'
View the table structure: mysql > desc 'table name'
View table records: mysql > select * from 'table name' limit 10
Modify the table
Modify the table name: mysql > rename table 'source table name' to 'new table name
Field record operation
Field
Add field: mysql > alter table 'table name' add 'field' 'modifier'
Delete field: mysql > alter table 'table name' drop 'field'
Modify fields: mysql > alter table 'table name' change 'old field' new field''modifier'
Record
Add record: insert into 'table name (record, record)' values (), (), ()
: insert into 'table name' values (), (), ()
Modify record: update 'table name' set field =''where field =''
Delete record: delete from 'table name' where 'word