一、插入資料
insert into 表名(欄位1,欄位2, ...) values(資料1, 資料2, ...);
二、洗掉資料
delete用來洗掉資料行,要配合where進行判斷,
#將student表中id=2的資料行洗掉
delete from student where id = 2;
三、修改資料
update陳述句用來修改資料,一般配合where或者having來進行條件判斷,
#將student表中id=1的name欄位的資料修改為chenih
update student set name='chenih' where id=1;
四、查看資料
select陳述句用來查詢資料,一般會配合where或者having來進行條件判斷,
select * from 表名;
select 欄位1, 欄位2, ..., 欄位n from 表名;
select * from 表名 where 欄位名='資料值';
select * from 表名 having 欄位名='資料值';
五、復制表格
1.復制表格的資料
原表里的欄位的屬性不會被復制,
#將新表名中的資料復制到新表名中
create table 新表名 select * from 原表名 ;
2.復制表的結構和屬性
不會復制原表中的資料,
create table 新表名 like 原表名 ;
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/38152.html
標籤:其他
上一篇:Base64檔案上傳
