CRUD Additions and deletions change
DCL Data Control Language: Backup,Grant
DML Data Manipulation language: CRUD
DDL Data Definition language:create drop alter
Self-growing columns cannot be assigned a value
Increase:
Insert into table name values(' ', ' ', ' ', ' ', ')--into can be omitted
By deleting:
Delete from table name (with log) (slow) truncate table name (does not write log, next execution self-growth column starts from 1 ) (FAST)
Delete from table where column name relationship operator value
Change:
Update table from set column name = value, column name = value,... , where Column name relational operator value
Check:
Select * from table
Select column name, column name,... from table
Select * from table where column name relational operator value and column name relational operator value
Select * from table where column between ten and (range query)
Select * from column where column in (3,4,5)
Select distinct column from table (column to weight)
Select * from car where name is like%5%% any number of arbitrary characters;_ an arbitrary character
Filtering on Columns--projection
Filter on Rows--filter
Row-Record ( tuple ) column--field ( Properties )
1 Select * fromFruit2 Select * fromFruitwhereStackinch(3,4,5)3 Select * fromCarwhereName like '%5%'--wildcard character% _4 Select * fromCarwhereName like '% Type'5 Select * fromCarwhereName like 'PO%'6 Select * fromCarwhereName like '% Type'7 Select * fromCarwhereName like '__[3,5]%'--the brackets indicate the choice8 --Sort9 Select * fromCarOrder byPrice--AscendingTen Select * fromCarOrder byPricedesc --Descending One Select * fromCarOrder byPrice,oilASC, exhaustdesc A Select * fromCarwherePrice> - Order by Price - --Statistics of 5 - Select COUNT(*) fromCarwhereName like 'Audi%'--how many records did the Audi start with? the Select AVG(Price) fromCar--statistics car All records the average of price - Select SUM(Price/Oil fromCar - Select *, (Price*0.9) JIU fold fromCar - SelectCode code, name fromCar + Select MAX(Price) fromCar - Select * fromCarwherePriceinch(Select MIN(Price) fromCar--find the record where the minimum value is located (row) + A --Grouping at SelectOilCOUNT(*) fromCarGroup byOilOrder by COUNT(*) - SelectOilCOUNT(*) fromCarwherePrice> - Group byOilOrder by COUNT(*) - SelectBrandMAX(Price) fromCarGroup byBrand - SelectBrandMin(Price) fromCarGroup byBrand - - SelectOilCOUNT(*) fromCarGroup byOil having COUNT(*)>=2 --having group after filtering in --Group statistics According to social Security numbers; Number of filters greater than 1 - SelectStack fromFruitGroup byStack having COUNT(*)>1
2014.9.3 database Crud