数据操纵

2018-10-20  本文已影响0人  咔狼

Data manipulation language

INSERT INTO

指定字段添加

INSERT INTO STUDENT(ST_ID,ST_NAME,ST_SEX,ST_JOIN_DATE)
VALUES(0000001,'小琪','女','20-5月-18');

按照默认字段顺序添加

INSERT INTO STUDENT VALUES(0002,'冯二','男','30-5月-17','学习');
INSERT INTO STUDENT VALUES(0003,'旭升','男','23-5月-17',NULL);

指定当前会话时间格式并按照新格式添加

-- 修改当前会话时间格式
ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';

INSERT INTO STUDENT VALUES(0006,'布偶','男','2017-10-19 21:47:38','吃小鱼干');

UPDATE

UPDATE STUDENT SET ST_HOBBIES='学习' WHERE ST_ID=5;
UPDATE STUDENT SET ST_HOBBIES='游泳' WHERE ST_ID=3 AND ST_HOBBIES IS NULL;
UPDATE STUDENT SET ST_HOBBIES=ST_HOBBIES||',游泳' WHERE ST_ID=4;

DELETE FROM

DELETE FROM STUDENT WHERE ST_HOBBIES='学习';
上一篇 下一篇

猜你喜欢

热点阅读