select sal,decode(sal>3000,'A',sal>2000,'B','C') grade from emp;
select sal,decode(sal,3000,'A',2000,'B','C') grade from emp;
select sal,(case when sal>3000 then 'A' when sal>2000 then 'B' else 'C' end) grade from emp;
select sal,(if sal>3000 then 'A' elsif sal>2000 then 'B' else 'C' end if) grade from emp;
第1题:
A.v_sal emp%rowtype;
B.v_sal emp.sal%type;
C.v_sal emp.sal.%type;
D.v_sal %type(emp.sal);
E.v_sal (emp.sal)%type;
第2题:
A.GRANT CHANGE ON SCOTT.EMP TO SA
B.GRANT UPDATE ON SCOTT.EMP(SAL) TO SA
C.GRANT UPDATE (SAL) ON SCOTT.EMP TO SA
D.GRANT MODIFY ON SCOTT.EMP(SAL) TO SA
第3题:
执行如下两个查询,结果为() Select ename name,sal salary from emp order by salary Select ename name,sal“salary”from emp order by sal asc
第4题:
数据库中有一张表名为Emp,包含有如下列:EmpNO(雇员编号,Varchar(20),Pk),Job(职位Varchar(10)),HirDate(雇佣日期,Date),Sal(月薪,Float)。要求查询全部雇员信息应该是哪些数据?()
第5题:
数据库中有一张表名为Emp,包含有如下列:EmpNO(雇员编号,Varchar(20),Pk),Job(职位Varchar(10)),HirDate(雇佣日期,Date),Sal(月薪,Float),Comm(奖金,Float,可为空)。查询出雇员编号为791,792,793的雇员信息是()
第6题:
Evaluate this SQL statement: SELECT ename, sal, 12* sal+100 FROM emp; The SAL column stores the monthly salary of the employee. Which change must be made to the above syntax to calculate the annual compensation as "monthly salary plus a monthly bonus of $100, multiplied by 12"? ()
第7题:
取出工资在2000到3000元(包括上下限)之间的员工()
第8题:
User SCOTT executes the following command on the EMP table but has not issued COMMIT, ROLLBACK, orany data definition language (DDL) command: SQL> SELECT ename FROM emp WHERE job=’CLERK’ FOR UPDATE OF empno; SCOTT has opened another session to work with the database instance. Which three operations would waitwhen issued in SCOTT’s second session()
第9题:
两个查询结果完全相同
第一个查询正确,第二个查询错误
两个查询结构不同
第二个查询正确,第一个查询错误
第10题:
GRANT CHANGE ON SCOTT.EMP TO SA
GRANT UPDATE ON SCOTT.EMP(SAL) TO SA
GRANT UPDATE (SAL) ON SCOTT.EMP TO SA
GRANT MODIFY ON SCOTT.EMP(SAL) TO SA
第11题:
LOCK TABLE emp IN SHARE MODE;
LOCK TABLE emp IN EXCLUSIVE MODE;
UPDATE emp SET sal=sal*1.2 WHERE job=MANAGER;
INSERT INTO emp(empno,ename) VALUES (1289,’Harry’);
SELECT ename FROM emp WHERE job=’CLERK’ FOR UPDATE OF empno;
第12题:
( 难度:中等)以下哪些Mysql语句是正确的?
A.select * from emp;
B.select ename,hiredate,sal from emp;
C.select * from emp order deptno;
D.select * from where deptno=1 and sal<300;
E.select * from where deptno=1 group by sal;
答案:ABD
第13题:
A.select * from emp wher sal in (2000,3000);
B.select * from emp wher sal like (2000,3000);
C.select * from emp wher sal = (2000,3000);
D.select * from emp wher sal between 2000 and 3000;
第14题:
A.select empno ,sum(sal) from scott.emp group by deptno
B.select * from scott.emp
C.select sum(sal) from scott.emp group by deptno
D.select count(empno) from scott.emp
第15题:
数据库中有一张表名为Emp,包含有如下列:EmpNO(雇员编号,Varchar(20),Pk),Job(职位Varchar(10)),HirDate(雇佣日期,Date),Sal(月薪,Float),Comm(奖金,Float,可为空)。查询出雇员编号不为791,792,793的雇员信息应该是用哪些数据查询?()
第16题:
数据库中有一张表名为Emp,包含有如下列:EmpNO(雇员编号,Varchar(20),Pk),Job(职位Varchar(10)),HirDate(雇佣日期,Date),Sal(月薪,Float)。查询出职位不为“办事员”的雇员信息是()
第17题:
对于雇员表(EMP)中的员工薪水(SAL)进行分级,3000元以上的为A级,2000元以上到3000元为B级,2000元及以下为C级,以下哪此操作能实现以上要求()
第18题:
授予sa用户在SCOTT.EMP表中SAL列的更新权限的语句是()。
第19题:
User SCOTT executes the following command on the EMP table but has not issued COMMIT, ROLLBACK, or any data definition language (DDL) command: SQL> SELECT ename FROM emp 2 WHERE job=’CLERK’ FOR UPDATE OF empno; SCOTT has opened another session to work with the database instance. Which three operations wouldwait when issued in SCOTT’s second session()
第20题:
select * from emp wher sal in (2000,3000);
select * from emp wher sal like (2000,3000);
select * from emp wher sal = (2000,3000);
select * from emp wher sal between 2000 and 3000;
第21题:
No change is required to achieve the desired results.
SELECT ename, sal, 12*(sal+100) FROM emp;
SELECT ename, sal, (12*sal)+100 FROM emp;
SELECT ename, sal+100,*12 FROM emp;
第22题:
v_sal emp%rowtype;
v_sal emp.sal%type;
v_sal emp.sal.%type;
v_sal %type(emp.sal);
v_sal (emp.sal)%type;
第23题:
LOCK TABLE emp IN SHARE MODE;
LOCK TABLE emp IN EXCLUSIVE MODE;
UPDATE emp SET sal=sal*1.2 WHERE job=ANAGER?UPDATE emp SET sal=sal*1.2 WHERE job=?ANAGER?
INSERT INTO emp(empno,ename) VALUES (1289,’Harry’);
SELECT ename FROM emp WHERE job=’CLERK’ FOR UPDATE OF empno