1. Optimize the table
2. Analyze the table (analyze and store the distribution of the keys in myisam and bdb tables)
3. Check the table (Check table errors and statistics of the update key for myisam)
4. Repair the table (repair the damaged myisam
1. Description: database creation tutorialCreate database-name2. Description: delete a database.Drop database dbname3. Description: Back up SQL server--- Create a device for the backup dataUse masterExec sp_addumpdevice 'disk', 'testback', 'c: mssql7
Ascii (str)Returns the ascii code value of the leftmost character of the str string. If str is a Null String, 0 is returned. If 'str' is null, return null.
Mysql tutorial> select ascii ('2 ');
-> 50
Mysql> select ascii (2 );
-> 50
Mysql>
Mysql tutorial database tutorial optimization is very important. Limit is the most commonly used and optimized. Mysql limit greatly facilitates paging. However, when the data volume is large, the performance of limit decreases sharply.
10 data
Modify my. ini file. Add the following set-variable = lower_case_table_names = 0 (0: Case Sensitive; 1: Case Insensitive) to the mysqld section and restart the mysql service.
1. lower_case_tables_name = 0 (default in linux)Start the mysql tutorial
1. log on to the system as a system administrator.2. Stop the mysql tutorial service.3. Go to the Command window and enter the mysql installation directory. For example, if my installation directory is c: mysql, go to c: mysqlbin.4. Skip the
Mysql tutorial Modify Table/field Add/delete table Index
Create table test (blob_col blob, index (blob_col (10); in mysql 5.1, for myisam and innodb tables, the prefix length can reach 1000 bytes. Note that the prefix limit should be measured in
Differences between Truncate and delete in mysql clearing tables this article demonstrates how to use the TRUNCATE command and the differences between delete and truncate. The following describes how to delete all data instances in a mysql
The "ALL" or "DISTINCT" option is used in the SELECT statement for deleting duplicate rows to display ALL rows that meet the conditions in the table or delete duplicate data rows in the table. The default value is "ALL. When the DISTINCT option is
Mysqldata warehouse contains many types of mysqldata warehouse. Next we will introduce the tool and directly back up data in mysql.exe.
Mysql tutorial database tutorial backup methodThere are many types of mysqldata warehouse backups. Next we will
The following describes two methods for importing excel Data to the mysql database. These two methods are simple and convenient, in the past, I used php programs to import excel Data to mysql databases. Now we don't need a program, just use the
If we use \ "select distinct Date \" in any SQL statement (or both sentences), we will get the same result.
SQL union allThe purpose of the union all command is to combine the results of two SQL statements. The difference between union all and union
This article introduces how to create and delete indexes in mysql. This tutorial only describes the index types supported by mysql 5.0, and briefly introduces the original design of indexes, indexes are the most commonly used tools in databases to
Grouping statistics statement for SQL data by day and month
Grouping statistics statement for SQL data by day and month/*In the database tutorial orders table, there is a "total" and a "createtime" field. Now we want to get the total of every day of
Optimization of table-level locking of MyISAM storage engine
MySQL supports table-level locking for MyISAM and MEMORY tables, page-level locking for BDB tables, and row-level locking for InnoDB tables.Table-level locks: low overhead, fast locking,
How to solve MySQL Chinese sorting errors/*
Method 1
Change the character set of the field to gbk, and then use order by to sort the field directly.
Mysql tutorial 5.x supports defining character sets for a column
Method 2
Add the "binary" attribute
Table table1Id RegName PostionSN PersonSN1 Shandong Qilu pharmaceutical 223 22 Shandong Qilu pharmaceutical 224 23 Beijing Urban Construction Company 225 24 technology companies 225 2
The result I want to obtain is
Id RegName PostionSN PersonSN1
Create a stored procedure in the mysql tutorial"Pr_add" is a simple mysql stored procedure, which has two int-type input parameters: "a" and "B", and returns the sum of the two parameters.
Drop procedure if exists pr_add;
-- Calculate the sum of
The and or operators are used to filter records based on more than one condition.And or operators
And or can combine two OR more conditions in the WHERE substatement.
If both the first AND second conditions are true, the AND operator displays a
Mysql tutorial paging optimization code for massive dataPage indicates the page number.Pagesize indicates the number of entries displayed on each page.Conditon indicates some conditions view sourceprint? 1 select * from table where conditon order by
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.