当前位置:网站首页>Database notes sorting
Database notes sorting
2022-07-27 16:48:00 【.Null】
Summary of knowledge points :
database :
effect ( comparison excel):
Security ( For servers ):
Reading and writing 、 Query power ( efficiency ):
MySQL:Concept : Relational database ( One or more tables ).
Header (header)、 That's ok (row)、 Column (col)、 value (value)、 key (key);data type :
Numeric type :( Integer and floating point )
Date and time :(data、time、datatime etc. )
String type :( character string 、 Text and binary, etc )keyword :(NULL、NOT NULL、DEFAULT etc. )
Using a database :
1) Log in to MySQL:
2) Create a database :create databases Database name ; -> show databases;
3) Select the database you want to operate on :use Database name ;
4) Create database tables :create table The name of the table ( List of statements );
5) Delete database tables :drop database Database name ;Operating the database ( And SQL The same ):
1) Insert data into table :insert into Table name values();
2) Query data in table :select Name from Table name [ Query criteria ];
Select * from Table name ;
DISTINCT keyword : Take an unrepeatable ;
Like/Not like
3) Query by specific conditions :select * from Table name where Conditions ;((where name like “% king %”))
4) Update the data in the table :update Table name set Column name = The new value where Update conditions ;
5) Delete data from table :delete from Table name where Delete the condition ;
summary : increase (insert into…values…)、 Delete (delete from…where…)、 Change (update…set…where…)、 check (select * from…where…).
SortModification after table creation :alter table …change/add/drop/rename/
Add columns 、 Modify the column 、 Delete column 、 rename table 、 Delete the entire table 、 Delete the entire database :
SQL Advanced :
1)like: 2)In: 3)Between: 4) link :inner join、left join、right join、full join 5)SQL function :
Aggregate function ( Clustering function ):avg()/count()/first()/last()/min()/sum()
Scalar function ( Scalar function ):ucase() Capitalization /lcase() A lowercase letter /mid() Extract characters /substring(1,end)/len()/round() rounding /now( Japan period )/format() format
Database tools : MySQL WorkBench
Create database -> Create table -> In the data -> Reading data ( operation )
10、 explain : A few simple basic sql sentence
choice :select * from table1 where Range
Insert :insert into table1(field1,field2) values(value1,value2)
Delete :delete from table1 where Range
to update :update table1 set field1=value1 where Range
lookup :select * from table1 where field1 like ’%value1%’ —like The grammar of is very exquisite , Check information !
Sort :select * from table1 order by field1,field2 [desc]
total :select count as totalcount from table1
Sum up :select sum(field1) as sumvalue from table1
Average :select avg(field1) as avgvalue from table1
Maximum :select max(field1) as maxvalue from table1
Minimum :select min(field1) as minvalue from table1
from( surface )+ Link query
Link query
• Internal connection :Inner join
• Left connection :Left join
• The right connection :Right join
Find out the common information of these two tables by inline (as Is the alias of the table , convenient ).
The left outer join : All the values in the left table will be displayed , The values in the right table show on Results of conditional search , Cannot search for NULL.
The right outer connection is opposite to the left outer connection ( The values in the right table are all displayed ).
边栏推荐
猜你喜欢
随机推荐
Cron expression use
TP5 -- query field contains a certain --find of search criteria_ IN_ SET
自然排序:comparable接口,定制排序:compartor接口的区别
The bill module of freeswitch
The class declared by the scala object keyword directly calls methods and associated objects
The whereor method of TP5 has many conditions
pdf 提取文字
C语言逆序输出字符串
Some queries of TP5
JSON data format usage
Bean: the difference between model and entity
(二)动态卷积之Dynamic Convolution
AS更换背景主题以及背景图片
Supplement - example of integer programming
201403-1
Embedded interview
Handling of multiple parts with duplicate names and missing parts when importing SOLIDWORK assemblies into Adams
清晰的认识Torchvision(思维导图版)
【论文阅读】A CNN-transformer hybrid approach for decoding visual neuralactivity into text
Simulation生成报表








