zoukankan      html  css  js  c++  java
  • 修改

    alter table t1 add(y int); 添加
    alter table t1 add(z int, a int);
    alter table t1 drop(z,a); 删除
    alter table t1 modify(y char); 修改类型
    alter table t1 modify(y default 'a'); 默认字段改成a
    alter table t1 disable novalidate constraint t1_x_pk; 关闭索引
    insert into t1 values (1,'a');
    insert into t1 values (1,'b');
    alter table t1 enable validate consitraint t1_x_pk; 开启索引



    视图
    优点:
    使复杂查询变简单

    安全限制访问 限制对底层敏感地区的访问

    数据库只限制到表级别

    竖列:
    整数的生成器

    cycle 循环 nocycle 不循环 // 一般是不循环

    cache 缓存 nocache 不缓存

    nextval 每调用一次就增长 currval 至查看当前值

    索引

    改善查询系统

    主键和唯一性约束自动创建索引:
    SQL> select constraint_name, constraint_type from user_constraints where table_name='EMPLOYEES';
    SQL> select index_name, index_type from user_indexes where table_name='EMPLOYEES';
    SQL> set autot on
    SQL> select last_name from employees where employee_id=100; 走索引
    SQL> select email from employees; 走索引
    SQL> select last_name from employees where salary=2100; 全表扫描
    SQL> create index emp_salary_ix on employees(salary);
    SQL> select last_name from employees where salary=2100; 走索引
    SQL> set autot off

    同义词

  • 相关阅读:
    支付宝接口对接常见问题
    Myeclipse中配置安卓环境
    算法精解概述
    使用Eclipse开始Java编程
    Windows使用SSH管理Ubuntu
    大臣的旅费
    剪格子
    波动数列
    买不到的数目
    逆波兰表达式
  • 原文地址:https://www.cnblogs.com/luo102154/p/7294733.html
Copyright © 2011-2022 走看看