|
本帖最后由 botang 于 2016-9-13 10:26 编辑
课程第7次2016-09-09星期五:
网络介绍完了。
关系型数据库基本概念和SQL五类语句介绍完了。
【1Z0-051】:共12章(0 1 2 3 4 5 6 7 8 9 10 11)
【1Z0-052】:共19章(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18)
【1Z0-053】:共21章(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)
共享服务器几个查询:
- select * from v$circuit;
- select * from v$dispatcher;
- select * from v$session where saddr='00000001EC928508';
复制代码
课程第8次2016-09-12星期一:
WHERE和ORDER BY以及空值
【1Z0-051】:共12章(0 1 2 3 4 5 6 7 8 9 10 11)
【1Z0-052】:共19章(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18)
【1Z0-053】:共21章(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)
2016-09-12.sql:
- select * from employees where employee_id=100;
- select employee_id, rowid ,rownum from employees
- where rownum=2;
-
- select * from employees e where e.department_id=80;
-
- SELECT last_name||' xxxx '||first_name "Last Name" , 12*salary*(1+nvl(commission_pct,0)) "Anaualsal"
- FROM employees;
- select * from employees
- where manager_id is null;
- SELECT department_name || q'# * #'
- || manager_id
- AS "Department and Manager"
- FROM departments;
- SELECT DISTINCT department_id
- FROM employees;
- select * from employees e
- where e.employee_id=178;
-
-
-
- create table t05101_distinct ( a varchar2(10) , b varchar2(10)) ;
-
- insert into t05101_distinct values ( 'A' ,'B' ) ;
- select distinct a, b from t05101_distinct ;
- insert into t05101_distinct values ( 'A' ,'B1' ) ;
-
- select distinct a from t05101_distinct ;
-
-
- select *
- from user_tab_cols tc
- where tc.TABLE_NAME='LOCATIONS';
-
- select * from employees
- where rownum=1;
- alter session set nls_date_format='YYYY-MM-DD';
- SELECT last_name
- FROM employees
- WHERE hire_date ='21-JUN-07';
- SELECT last_name
- FROM employees
- WHERE hire_date = to_date('21-JUN-07','DD-MON-RR') ;
- ---
- select *
- from employees e
- where e.employee_id not in
- (select manager_id from employees
- where manager_id is not null);
- xx and yy and zz and null
- create table t05102_a ( a varchar2(10)) ;
- insert into t05102_a values ('A' ) ;
- insert into t05102_a values ('A1' ) ;
- insert into t05102_a values ('%' ) ;
- insert into t05102_a values ('_' ) ;
- insert into t05102_a values ('_1' ) ;
- select * from t05102_a;
- select * from t05102_a where a like 'A%';
- select * from t05102_a where a like 'A_';
- select * from t05102_a where a like '%%';
- select * from t05102_a where a like '\%%' escape '\';
- select * from t05102_a where a like '\_%' escape '\';
- insert into t05102_a values ('''');
- select * from t05102_a;
- insert into t05102_a values (chr(39)||1);
- ---
- create table t05102_b ( a number , b number ) ;
- insert into t05102_b values ( 1 , 999) ;
- insert into t05102_b values ( 1 , 0) ;
- insert into t05102_b values ( 2 ,999);
- insert into t05102_b values (2,0);
- select * from t05102_b
- order by a desc ,b desc ;
-
-
- select employees.employee_id
- from employees e ;
-
-
-
-
-
-
- select a "X" , b "Y" from t05102_b
- order by 1 desc,2 ;
-
-
- select employee_id, salary
- from employees
- where employee_id=&S_1;
-
- select &S_1;
复制代码
|
|