oracle 数据库查询

这篇博客详细介绍了如何在Oracle数据库中进行用户管理、创建表、插入数据、查询数据、修改表结构、处理NULL值、排序、分组、子查询、多表查询、视图以及分页操作。涵盖了从基础到进阶的各种查询技巧。
摘要由CSDN通过智能技术生成

–如果用户存在 则删除级联删除整个用户

–建用户
create user scott identified by 123456 default tablespace System;

–授权
grant connect,resource to scott;
grant create any sequence to scott;
grant create any table to scott;
grant delete any table to scott;
grant insert any table to scott;
grant select any table to scott;
grant unlimited tablespace to scott;
grant execute any procedure to scott;
grant update any table to scott;
grant create any view to scott;

–建表雇员表
CREATE TABLE EMP
(
EMPNO CHAR(4),
ENAME VARCHAR2(20),
JOB VARCHAR2(20),
MGR VARCHAR2(20),
HIREDATE DATE,
SAL NUMBER(10,2),
COMM NUMBER(10,2),
DEPARTMENT CHAR(2)
);

–插入一条数据
INSERT INTO EMP VALUES(‘7369’,’smith’,’clerk’,’7902’,’1980/12/17’,800,0,20);

–修改oracle默认的日期格式
alter session set nls_date_format = ‘yyyy-mm-dd hh24:mi:ss’;

–查询数据 <

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值