新增數據
方案1:給全表字段插入數據,不需要指定字段列表;要求數據的值出現的順序必須與表中設計字段出現順序一致;凡是非數值數據,都需要使用引號(單引號建議)括起來
insert into 表名 values (值列表) [,(值列表)]; -- 可以一次性插入多條數據
方案2:給部分字段插入數據,需要選定字段列表;值列表順序必須與選定的字段的順序一致;
insert into 表名 (字段列表) values (值列表) [,(值列表)];
查看數據
查看指定字段指定條件的數據 select */字段列表 from 表名 [where 條件 ];
select id,number,name,sex from my_student where id=1;
更新數據 update 表名 set 字段 =值 [where 條件]
update my_student set sex='m where name='張三';
刪除數據 delete from 表名 [where 條件];