易截截图软件、单文件、免安装、纯绿色、仅160KB

sql语句基础

--sql structured query language
--DML--Data Manipulation Language--数据操作语言
query information (SELECT),
add new rows (INSERT),
modify existing rows (UPDATE),
delete existing rows (DELETE),
perform a conditional update or insert operation (MERGE),
see an execution plan of SQL (EXPLAIN PLAN),
and lock a table to restrict access (LOCK TABLE).
--DDL--Data Definition Language--数据定义语言
create, modify,drop, or rename objects (CREATE,ALTER,DROP,RENAME),
remove all rows from a database object without dropping the structure (TRUNCATE),
manage access privileges (GRANT,REVOKE),
audit database use (AUDIT,NOAUDIT)
and add a description about an object to the dictionary (COMMENT).
--Transaction Control事务控制语句
save the changes(COMMIT)
or discard the changes (ROLLBACK) made by DML statements.
Also included in the transaction-control statements are statements to set a point or marker in the transaction for possible rollback (SAVEPOINT)
and to define the properties for the transaction (SET TRANSACTION).
Used to manage the properties of the database.
There isonly one statement in this category (ALTER SYSTEM).
--DCL--Data Control Language--与开发关系不是很密切,用于权限的分配与回收
grant,revoke,data control
--Session Control
control the session properties (ALTER SESSION)
and to enable/disable roles (SET ROLE).
--System Control
--------------------------------------------------------
select的用法
--每个员工的所有信息
select * from emp
--每个人的部门编号,姓名,薪水
select deptno,ename,sal from emp;
--每个人的年薪
select ename,sal*12 from emp;
--计算2*3的值
select 2*3 from emp;
--计算2*3的值(dual)
select 2*3 from dual;
select * from dual;
--得到当前时间
select sysdate from dual
--可以给列起别名,比如求每个人的年薪
select ename,sal*12  salperyear from emp;
--如果别名中有空格,需要用双引号
select ename,sal*12  "sal per year" from emp;
--如果没有内容,则为空
select comm from


相关文档:

删除sql 2005 日志

1、截断日志:  
  backup   log   数据库   with   no_log  
   
  或:  
  清空日志  
  DUMP     TRANSACTION     库名     WITH     NO_LOG    
   
  2、 & ......

重新编译所有无效的PL/SQL模块(对象)

当Oracle数据库创建完成后,系统将会自动运行utlrp.sql这个脚本文件(D:\oracle\product\10.1.0\Db_1\RDBMS\ADMIN),但是,当通过定制安装类型的方式创建了数据库时,系统则不会运行utlrp.sql这个脚本,所以,建议在创建、更新或迁移一个数据库后,运行一下utlrp.sql这个脚本,以验证数据库安装是否成功,这样可以重新编译 ......

Access数据库字段类型说明以及与SQL之间的对照关系

文本 nvarchar(n)
备注 ntext
数字(长整型) int
数字(整型) smallint
数字(单精度) real
数字(双精度) float
数字(字节) tinyint
货币 money
日期 smalldatetime
布尔 bit
附:转换成SQL的脚本。
ALTER TABLE tb ALTER COLUMN aa Byte 数字[字节]
ALTER TABLE tb ALTER COLUMN aa Long 数字[长整型]
ALTER T ......

用SQL建立索引

  假设你想找书中的某一个句子。你可以一页一页地逐页搜索,但这会花很多时间。而通过使用索引,你可以很快地找到你要搜索的主题。
  表的索引与附在一本书后面的索引非常相似。它可以极大地提高查询的速度。对一个较大的表来说,通过加索引,一个通常要花费几个小时来完成的查询只要几分钟就可以完成。因此没有理由对 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号