Chinaunix首页 | 论坛 | 博客
  • 博客访问: 24988
  • 博文数量: 25
  • 博客积分: 1010
  • 博客等级: 少尉
  • 技术积分: 270
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-22 20:04
文章分类

全部博文(25)

文章存档

2011年(1)

2009年(24)

我的朋友
最近访客

分类: Oracle

2009-07-22 20:58:46

☆ 运行 oracle10g : 在运行中输入-----sqlplus /nolog---注: 运行oracle并且不登陆;
 
☆ 启动isqlplus   : 在浏览器中输入
 
☆ Oracle 连接身份 :1.normal(默认)
                   2.sysoper系统操作员
                   3.sysdba 系统管理员
 
☆ oracle默认帐户: sys和system 其中sys登录必须加as sysdba 或者as sysoper 例如:
                  conn sys/orcl as sysdba
 
☆ 登录oracle数据库: conn 用户名/密码  as 连接身份
 
☆ show user;-----------显示当前用户
 
☆ 创建用户:create user 用户名 identified by 密码;
 
☆ 赋予权限:grant dba to 用户名;----赋予该用户dba权限
 
☆ @F:\数据库文件\演示数据库数据.sql;-------加载脚本生成数据
 
☆ drop user 用户名 cascade;----删除用户
 
☆ 查看表结构:desc student;
 
☆ 查看表中内容: select * from 表名;
 
☆  set linesize 200;----一行显示200个字符
    set pagesize 200;----一列显示200个字符
    set wrap off;--------如果一行超出200个字符,多余的字符将截断
 
☆ select语句中接的几个关键字:where、between and 、in、 like 、is null ;
 
☆ 比较运算符: >,<,<=,>=,=,<>不等于
 
☆ 查询中where后接条件: select sname from student where sage=16;
 
☆ between ...and...(否定在between前面加not)
   例:------------雇用日期在21-9月 -89到28-9月 -97之间的人
        select first_name from employees
        where hire_date between '21-9月 -89' and '28-9月 -97';
 
☆ in(否定就是在in前面加not)
        select first_name,salary from employees
        where salary in (6000,9000,10000,15000);
 
☆ like(否定就是在like前面加not)
          %代表任意个字符         _代表任意一个字符
     select first_name,salary from employees  where first_name like 'A%e_';
 
☆ is null(否定是is not)
              null 不是值,是一个非分配,未知的状态
        select first_name,salary,commission_pct from employees
        where commission_pct is  null;
 
☆ order by 排序关键字
    select sname,ssex,sage from student where ssex='男' order by sage desc;
    降序用desc 升序 用 ASC  默认是 升序
    注意:排序null在降序排在最上,升序排在最下(就当它最大)
 
阅读(233) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:oracle10g培训日志☆2

给主人留下些什么吧!~~