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

    同义词

  • 相关阅读:
    地铁结队开发(一)
    构建之法(一)——软件工程师的成长
    第二周学习总结
    新的开始
    开学第一周作业
    第一周学习总结
    软件工程第六周总结
    软件工程第五周总结
    清明节第三天
    清明节第二天
  • 原文地址:https://www.cnblogs.com/luo102154/p/7294733.html
Copyright © 2011-2022 走看看