sql語句是什么

結(jié)構(gòu)化查詢語言(structured query language)簡稱sql,結(jié)構(gòu)化查詢語言是一種數(shù)據(jù)庫查詢和程序設(shè)計語言,用于存取數(shù)據(jù)以及查詢、更新和管理關(guān)系數(shù)據(jù)庫系統(tǒng);

sql語句是什么

sql語句就是對數(shù)據(jù)庫進(jìn)行操作的一種語言。(推薦學(xué)習(xí):MySQL視頻教程

程序功能

創(chuàng)建數(shù)據(jù)庫

CREATE DATABASE database-name

刪除數(shù)據(jù)庫

drop database dbname

創(chuàng)建新表

create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..)

刪除新表

drop table tabname

常見語句

更新:update table1 set field1=value1 where 范圍

查找:select * from table1 where field1 like ’%value1%’ (所有包含‘value1’這個模式的字符串)

排序:select * from table1 order by field1,field2 [desc]

求和:select sum(field1) as sumvalue from table1

平均:select avg(field1) as avgvalue from table1

最大:select max(field1) as maxvalue from table1

最小:select min(field1) as minvalue from table1[separator]

更多MySQL相關(guān)技術(shù)文章,請訪問MySQL視頻教程欄目進(jìn)行學(xué)習(xí)!

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點贊11 分享