General Query:
One: Query all data
SELECT * FROM Info check all data
Select Code,name from Info for specific columns
Second: According to the conditions to check
SELECT * from Info where code= ' p001 ' a conditional query
SELECT * from Info where code= ' p001 ' and nation= ' n001 ' multi-condition and relational query
SELECT * from Info where name= ' hu June ' or nation= ' n001 ' multi-condition or relational query
SELECT * from Car where price>=50 and price<=60 range query
SELECT * from Car where price between 60 and range query
Three: Fuzzy query
SELECT * from Car where Name '% type '% wildcard represents any number of characters
SELECT * from Car where Name '% audi% ' _ wildcard represents any one character
SELECT * from Car where Name like ' _ Horse% '
Four: Sort
SELECT * from Car ORDER BY price ASC in ascending order
SELECT * from Car ORDER BY price desc in descending order of prices
The SELECT * from Car ORDER by Price,oil is sorted by two columns, preceded by the primary
Five: Statistical function (aggregate function)
Select COUNT (Code) from Car query table how many data
Maximum value of select Max from Car fetch price
Select min (price) the minimum value from Car pickup
Select SUM (Price) The sum of the prices from Car fetch
Average of Select AVG (price) from Car fetch prices
Six: Group query
Select brand from Car GROUP by Brand has count (*) >2 query for all series with a quantity greater than 2
Seven: Paging query
SELECT * from Car limit 0, 5 skip a few data to fetch several data
Eight: Go to re-query
Select distinct Brand from Car
 
Database---General query