1.查看该公司的员工分布在哪几个部门 select distinct deptno from emp; 2.查看每个部门有哪些岗位 select distinct deptno , job from emp order by deptno; 3.查询工资每月1600的员工姓名和工作岗位 select ename ,job,sal from emp where sal=1600; 4.查询姓名为SMITH的所有信息 select * from emp where ename = 'SMITH';
1 有关日期格式属性改动常识 NLS_DATE_FORMAT DD-MON-RR select sysdate from dual; NLS_CURRENCY ¥ 能够通过以下的方式查到上面的格式默认參数: 2 v$nls_parameters SQL>select * from v$nls_parameters; 结果略: 3改动默认參数 alter session set NLS_DATE_FORMAT='DD-MON-RR'; alt
.当前的数据库连接数 select count(*) from v$process where program='ORACLE.EXE(SHAD)'; .数据库允许的最大连接数 select value from v$parameter where name ='processes' .修改最大连接数,需要重启数据库才能生效: scope = spfile; .重启数据库 shutdown immediate; startup; ||'s',b.sql_text,machine from v$s
/*以下代码是对emp表/dept表/salgrade表进行显示宽度设置 */col empno for 9999;col ename for a10;col job for a10;col mgr for 9999;col hiredate for a12;col sal for 9999;col comm for 9999;col deptno for 99;col dname for a14;col loc for a14;col grade for 9999;col tname for
题目描述 获取有奖金的员工相关信息.CREATE TABLE `employees` (`emp_no` int(11) NOT NULL,`birth_date` date NOT NULL,`first_name` varchar(14) NOT NULL,`last_name` varchar(16) NOT NULL,`gender` char(1) NOT NULL,`hire_date` date NOT NULL,PRIMARY KEY (`emp_no`));CREATE TAB
1.作业需求: (1).工信息表程序,实现增删改查操作: (2).可进行模糊查询,语法至少支持下面3种: select name,age from staff_table where age > 22 select * from staff_table where dept = "IT" select * from staff_table where enroll_date like "2013" (3).查到的信
--通用sql select deptno, ename, sal from emp e1 where ( ) from emp e2 where e2.deptno=e1.deptno and e2.sal>=e1.sal ) /*这里的数值表示你想取前几名*/ order by deptno, sal desc; --oracle查询 select * from (select deptno,ename,sal,row_number() over (partition by deptno o
/*--以下代码是对emp表进行显示宽度设置col empno for 9999;col ename for a10;col job for a10;col mgr for 9999; col hiredate for a12;col sal for 9999;col comm for 9999;col deptno for 99;set pagesize 20; --创建新表new_emp,复制emp表中的结构和数据到new_emp表中create table xxx as select *
非常经典的一些日常醒脑练习内容!! 如有更高效的写法欢迎赐教! .已知Oracle的Scott用户中提供了三个测试数据库表,名称分别为dept,emp和salgrade.使用SQL语言完成以下操作 )试用SQL语言完成下列查询(单表查询): a)查询20号部门的所有员工信息: ; b)查询奖金(COMM)高于工资(SAL)的员工信息: select * from emp where comm>sal; c)查询奖金高于工资的20%的员工信息: select * from emp where