首先學習最基礎(chǔ)的增刪改查
列:有一個學生類的數(shù)據(jù)庫表
表名稱 Student
表結(jié)構(gòu) id,name,sex,age,address
增加一條數(shù)據(jù): insert into Student(name,sex,age,address) values("名稱","性別","年齡","地址")
每一個字段對應(yīng)一條內(nèi)容
刪除一條數(shù)據(jù): delete * from Student where id = "數(shù)據(jù)所對應(yīng)的id"
修改一條數(shù)據(jù) update Student set name="內(nèi)容",sex="內(nèi)容" where id ="數(shù)據(jù)所對應(yīng)的id"
查詢一條數(shù)據(jù) select * from Student where id="數(shù)據(jù)所對應(yīng)的id"
"*" 表示查詢這條數(shù)據(jù)的所有字段
排序 在where條件末尾加 order by 字段名稱 desc
asc 是正序 desc 是倒敘 不加默認是正序
初學者寫sql時的順序是:先寫from ,再寫where條件,最后寫select查詢。
遠近互聯(lián)技術(shù)-劉 整理發(fā)布,希望能對同是技術(shù)的你有所幫助。
遠近互聯(lián)專業(yè)提供網(wǎng)站建設(shè)、APP開發(fā)、網(wǎng)站優(yōu)化、外貿(mào)網(wǎng)站SEO、微信運營的品牌整合營銷服務(wù),讓客戶通過網(wǎng)絡(luò)品牌建立與網(wǎng)絡(luò)傳播提高業(yè)績。






