數(shù)據(jù)庫

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

//create database 數(shù)據(jù)庫名稱

//創(chuàng)建一個數(shù)據(jù)庫列表

//create tabele(列表名陳)

//向表中插入數(shù)據(jù)

//insert into (表名)values(屬性值)

//查詢列表中的數(shù)據(jù)

//select(列名稱)from表名稱【查詢條件】

//例;select name age from student

//select *from student;(*)表示查找表中所有內容

//指定條件查找表中所有性別為女的數(shù)據(jù)

//select* from student where sex=“女”

//查找年齡21歲以上的所有人信息

//select * from student where age>21;

//查找名字中帶有‘王’的所有人信息

//select * from student where name like “%王%”;

//查詢id小于5且年齡大于20的所有人信息:

//select * from student where id<5 and age>20;

//更改表中數(shù)據(jù) 用“update”

//把id為5的手機號改為-

//update student set number=- where id=5;

//所有人年齡加1

//update student set age=age+1;

//將手機號為 13288097888 的姓名改為 "張偉鵬", 年齡改為 19:

//update student set name=“張偉鵬”age=19 where number=13254515

//刪除 關鍵字‘delete‘---delete from 表名稱 where 刪除條件;

//刪除id為2的行

//delete from student where id=2

//alter table 語句用于創(chuàng)建后對表的修改;添加

//alter table [表名] add【列名】 【列數(shù)據(jù)類型 插入位置】

//在名為 age 的列后插入列 birthday:

//alter table student add birthday data age;

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容