Basic exercises for MySQL database
- Create a database
- Working with databases
- Create a table
- Char: fixed-length constant
- VARCHAR: variable
- Show Table
- View table Structure
- Inserting data
SHA1 (): Encrypt data function, create an encrypted word a, which is exactly 40 characters long
- View all elements
WHERE Condition Statement
- Between ...
Like/not like
- Wildcard _: matches a single character;%: matches 0 or more characters
- Precede the wildcard with (\), then _ or% is only the original symbol and does not have a wildcard meaning.
- Queries with like conditional statements are generally slow because the index cannot be used, so this format should be used only when absolutely necessary
Sort order BY ascending ASC Descending desc
- To sort the columns that are enum types, sorting is based on the order in which the enum values are created by the column.
Limit
- LIMIT x: Returns the first X record in the query record
- LIMIT x, y: Returns the Y record starting with the X record
- The limit clause does not improve the execution speed of the query because MySQL still has to assemble each record together, and then truncate the list
- Update, delete
- To prevent yourself from accidentally updating too many rows, you can apply a limit clause to update
- Clears a table, preferring truncate:truncate table tablename
- To delete all the data in the table and the table itself: Drop table tablename;
- To delete an entire database: Drop DB databasename
- Concat connection function
- CONCAT_WS Connection function
- Length function
- Format function
- Concat in combination with the Format function
- Rand () function
- Now (), Curtime (), curdate () function
- 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); }); });
The above describes the PHP learning practiced hand (v), including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.