: This article mainly introduces PHP practitioners (5). If you are interested in the PHP Tutorial, refer to it. Basic exercises for MySQL databases
- Create a database
- Use Database
- Create a table
- Char: constant
- Varchar: variable
- Display Table
- View table structure
- Insert data
SHA1 (): the data encryption function. it creates an encrypted character and its length is exactly 40 characters.
- View all elements
WHERE condition statement
- Between... And...
LIKE/NOT LIKE
- Wildcard _: match a single character; %: match 0 or multiple characters
- If '\' is added before the wildcard, '_' or '%' is used only as the original symbol and does not have the wildcard meaning.
- Queries with the LIKE condition statement are generally slow. because indexes cannot be used, this format should be used only when absolutely needed.
Sort order by ascending ASC descending DESC
- If the column to be sorted is of the ENUM type, the sorting is based on the order in which the ENUM value is created.
Limit
- Limit x: returns the first X records in the query record.
- Limit x, Y: return Y Records starting from X Records
- The LIMIT clause does not improve the query execution speed, because mysql still has to combine each record and then truncate the list.
- Update, delete
- To prevent accidental updating of too many rows, you can apply a limit clause to update
- Truncate: truncate table is preferred for clearing a TABLE.Tablename
- To delete all data in the TABLE and the TABLE itself: DROP TABLETablename;
- To delete the entire DATABASE: DROP DATABASEDatabasename
- Concat connection function
- Concat_ws connection function
- Length function
- Format function
- Use concat and format functions
- Rand () functions
- Now (), curtime (), curdate () functions
- Date_format function
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above introduces PHP learning and practice (5), including some content, and hopes to help those who are interested in PHP tutorials.