Common SQL statement query and sharing
-- Create a database (File: main data file mdf = 1, secondary data file ndf> = 0, log file ldf> = 1)-- File group: When 1mdf, 5 ndf (, 2), 10 ldf (, 4), they are divided into multiple groups for storage.
CREATE
When analyzing query performance, it is also useful to consider the EXPLAIN keyword. The EXPLAIN keyword is generally placed before the SELECT query statement to describe how MySQL performs the query operation, and the number of rows to be executed
Copy codeThe Code is as follows: -- ACL Tables
-- Table structure 'aclresources'
Drop table if exists 'aclresources ';
Create table if not exists 'aclresources '(
'Rsid 'varchar (64) not null,
'Access' int (4) not null default 0,
'Desc' varchar (240)
Finally, I have finished a simple implementation. For more information about php learning, see.
The Code is as follows:
-- ACL Tables-- Table structure 'aclresources'Drop table if exists 'aclresources ';Create table if not exists 'aclresources '('
In-depth analysis of explain for MySQL Query optimization MySQLexplain
BitsCN.com
When analyzing query performance, it is also useful to consider the EXPLAIN keyword. The EXPLAIN keyword is generally placed before the SELECT query statement to
Finally, I have finished a simple implementation. For more information about php learning, see.
Copy codeThe code is as follows:
-- ACL Tables
-- Table structure 'aclresources'
Drop table if exists 'aclresources ';
Create table if not exists
Copy codeThe Code is as follows:-- ACL Tables-- Table structure 'aclresources'Drop table if exists 'aclresources ';Create table if not exists 'aclresources '('Rsid 'varchar (64) not null,'Access' int (4) not null default 0,'Desc' varchar (240) not
The simple ACL code in php is as follows:
-- ACL Tables
-- Table structure 'aclresources'
Drop table if exists 'aclresources ';
Create table if not exists 'aclresources '(
'Rsid 'varchar (64) not null,
'Access' int (4) not null default 0,
'Desc'
Basic MySQL Data Table operation 3: comprehensive example
1. Create a database
mysql> create database company;mysql> use company;
Ii. Create a table
1. Create an offices table
mysql> create table offices -> ( -> officeCode int(10) NOT NULL
Basic MySQL Data Table operation 3: A comprehensive example of basic mysql operations
1. Create a database
mysql> create database company;mysql> use company;
Ii. Create a table
1. Create an offices table
mysql> create table offices -> ( ->
1 description (1) for the MyISAM table, if the auto-increment column is updated using UPDATE, if the column 20540 is repeated with the existing 20540, an error will occur. if the column is greater than the existing maximum 20540 ;, the
Update table_xxx set a=a+1 where documentid=123
If the database is 10, then 11 is executed.But the final result is always 12, I have been depressed for a day, how to do. The program does not have any problems, I use the MySQL class, and the
MySQL "replace into", mysqlreplaceinto
MySQL has many extensions for SQL, some of which are very convenient to use, but some may have performance problems after misuse, and some unexpected side effects, such as REPLACE.
For example, there is a table:
Precautions for using the AUTO_INCREMENT column in MySQL: update auto-incrementing Column1. Description
(1) For the MyISAM table, if you use UPDATE to UPDATE the auto-incrementing column, if the column value is the same as the existing value, an
Injection of tens of thousands of users (name, password, transaction password, region, mobile phone number, etc)
I heard my boss sent an iPhone 6 plus?Injection of another store database to the main site
Injection:
python sqlmap/sqlmap.py -u "https:
MySQL innodb_table_stats table does not exist
MySQL version 5.6.14
The company's error logs for several MySQL servers show that several system tables do not
Anyone familiar with Oracle knows that when the Oracle database cannot be started normally, you can use dul or other third-party tools to directly read data in the data file to save data and reduce losses, if the innodb engine is used in mysql,
We can directly use alter to modify the character set of the mysql table. However, we should pay attention to the inclusion relationship between codes when modifying the data set. It is best to back up the data table to avoid garbled characters.
The
MySQL foreign key constraint cascading deletion when updating a database, the first table is used to store some simple blog data, and the second table is used to store comments related to these blogs. This example cleverly defines a foreign key
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.