-
下列哪个语句查出雇员表(employees)里的雇员名字(ename)是‘SMITH’的信息,并且给雇员名字(ename)列定义一个别名Name()。
A . select employeesno,ename Name,job from employees where ename=‘SMITH’
B . select employeesno,ename ‘Name’,job from employees where ename=SMITH
C . select employeesno,ename “Name”,job from employees where ename=‘SMITH’
D . select employeesno,ename ‘Name’,job frome mployees wheree name=‘SMITH&rsquo
-
如果对关系emp(eno,ename,salary)成功执行下面的SQL语句: CREATE CLUSTER INDEX name_index ON emp(salary) 对此结果的正确描述是()。
A . 在emp表上按salary升序创建了一个唯一索引
B . 在emp表上按salary降序创建了一个唯一索引
C . 在emp表上按salary升序创建了一个聚簇索引
D . 在emp表上按salary降序创建了一个聚簇索引
-
对于雇员表(EMP)中的员工薪水(SAL)进行分级,3000元以上的为A级,2000元以上到3000元为B级,2000元及以下为C级,以下哪此操作能实现以上要求()
A . select sal,decode(sal>3000,'A',sal>2000,'B','C') grade from emp;
B . select sal,decode(sal,3000,'A',2000,'B','C') grade from emp;
C . select sal,(case when sal>3000 then 'A' when sal>2000 then 'B' else 'C' end) grade from emp;
D . select sal,(if sal>3000 then 'A' elsif sal>2000 then 'B' else 'C' end if) grade from em
-
如果对关系emp(eno,ename,salary)成功执行下面的SQL语句:CREATECLUSTERINDEXname_indexONemp(salary),其结果是()
A . 在emp表上按salary升序创建了一个聚簇索引
B . 在emp表上按salary降序创建了一个聚簇索引
C . 在emp表上按salary升序创建了一个唯一索引
D . 在emp表上按salary降序创建了一个唯一索引
-
假设emp表包含一个婚姻状况的字段,则应该在该字段上创建()索引。
A、B树唯一索引
B、B树不唯一索引
C、基于函数的索引
D、位图索引
-
The EMP table has these columns: ENAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATE Management wants a list of names of employees who have been with the company for more than five years. Which SQL statement displays the required results? ()
A . SELECT ENAME FROM EMP WHERE SYSDATE-HIRE_DATE >5;
B . SELECT ENAME FROM EMP WHERE HIRE_DATE-SYSDATE >5;
C . SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)/365 >5;
D . SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)*/365 >5
-
pl/sql中有4条与游标有关的语句,他们在程序中出现的正确顺序是() 1 open abc 2 cursor abc is select ename from emp 3 fetch abc into vname 4 close abc
A . 1234
B . 2134
C . 2314
D . 1324
-
对于以下SQL语句说法正确的是() SELECT ename FROM emp WHERE sal IN (SELECT MAX(sal) FROM emp GROUP BY deptno);
A . 这个语句是符合语法的
B . 这个语句是不能执行的,因为缺少HAVING子句
C . 这个语句是不能执行的,因为分组的条件列不在SELECT列表中
D . 这个语句是不能执行的,因为GROUP BY子句应该在主查询中,而不是在子查询中
E . 在主查询的WHERE条件中,不应该用IN,而应该用等号
-
执行如下两个查询,结果为() Select ename name,sal salary from emp order by salary Select ename name,sal“salary”from emp order by sal asc
A . 两个查询结果完全相同
B . 第一个查询正确,第二个查询错误
C . 两个查询结构不同
D . 第二个查询正确,第一个查询错误
-
emp表是雇员信息表,以下哪个变量可以存放emp表中的一条记录()
A . v_record emp%type;
B . v_record emp%recordtype;
C . v_record emp%record_type;
D . v_record emp%rowtype;
E . v_record emp%row_type
-
emp表是雇员信息表,sal字段存放是的雇员的月薪,以下哪个变量可以存放sal类型的值()
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
-
Evaluate the SQL statement: SELECT LPAD (salary,10,*) FROM EMP WHERE EMP _ ID = 1001; If the employee with the EMP_ID 1001 has a salary of 17000, what is displayed?()
A . 17000.00
B . 17000*****
C . ****170.00
D . **17000.00
E . an error statement
-
假设emp表有4条数据,dep表有3条数据,则执行SELECT emp.ename,dep.dname FROM emp,dep的结果为()。
A . 语法错误
B . 有数据行返回,返回的行数要根据表中数据的具体情况来分析
C . 返回3行数据
D . 返回12行数据
-
现有表user,字段:userid,username,salary,deptid,email;表department,字段:deptid,deptname;下面()应采用检查约束来实现。
A.A.若department中不存在deptid为2的纪录,则不允许在user表中插入deptid为2的数据行
B.B.若user表中已经存在userid为10的记录,则不允许在user表中再次插入userid为10的数据行
C.C.User表中的salary(薪水)值必须在1000元以上
D.D.若User表的email列允许为空,则向user表中插入数据时,可以不输入email值
-
设有如下两个关系,其中雇员信息表关系EMP的主键是雇员号,部门信息表关系DEPT的主键是部门号。下面所列出的操作中,哪个操作可以成功执行? () EMP<img src='https://img2.soutiyun.com/shangxueba/ask/1881001-1884000/1882029/ct_chibm_chibchoose_04495(20092).jpg' />
A.在DEPT中插入行('03','计划部','5号楼')
B.在EEMP中插入行('102','赵敏','05',1500)
C.将DEPT中部门号='02'的部门号改为'10'
D.从EMP中删除行('010','王宏达','01',1200)
-
在雇员信息表中关系EMP中,()属性是外键。A.雇员号B.雇员名C.部门号D.工资
在雇员信息表中关系EMP中,()属性是外键。
A.雇员号
B.雇员名
C.部门号
D.工资
-
在雇员信息表关系EMP中,哪个属性是外码?()
A.A.雇员号
B.B.雇员名
C.C.部门号
D.D.工资
-
pl/sql中有4条与游标有关的语句,他们在程序中出现的正确顺序是()1 open abc2 cursor abc is select ename from emp3 fetch abc into vname4 close abc
A.1234
B.2134
C.2314
D.1324
-
Examine the following commands and their output:SQL> SELECT ename, sal FROM emp WHERE ename=‘JAMES‘; ENAME SAL JAMES 1050QL> UPDATE emp SET sal=sal+sal*1.2 WHERE ename=‘JAMES‘;1 row updated.SQL> SELECT ename, sal FROM emp WHERE ename=‘JAMES‘; ENAME SAL JAMES 2310View the exhibit and examine the Flashback Version Query that was executed after the preceding commands.What could be the possible cause for the query not displaying any row?()
<img src='https://img2.soutiyun.com/ask/uploadfile/2019-03-27/a303b81782e5cc63228b13b8df2b43c9.jpg' />
A. Flashback logging is not enabled for the database.
B. The changes made to the table are not committed.
C. Supplemental logging is not enabled for the database.
D. The database is not configured in ARCHIVELOG mode.
-
设有职工基本表:EMP(ENO,ENAME,AGE,SEX,SALARY,DNO),其属性分别表示职工号、姓名、年龄、性别、工
设有职工基本表:EMP(ENO,ENAME,AGE,SEX,SALARY,DNO),其属性分别表示职工号、姓名、年龄、性别、工资,所在车间的编号。试用关系代数表达式表示下列查询语句:检索年龄小于23岁的男职工的职工号和姓名
-
分析下面的SQL语句,哪一部分引起错误? ()select empno,sum(sal) ‘salary’ from emp where sal
A.order by 2
B.from emp
C.where sal>1500
D.group by empno
-
50、设关系Teacher的结构为:Teacher(T char(3), Tname char(10), D char(2), Salary float(2)),其中T教师编号,Tname教师姓名,D系号,Salary工资。Dept(D char(2),Dname char(10),Dean char(10)),Dname系名,Dean系主任。若要将所有计算机系的教师工资上调10%,则可用_________。
A.Update Salary = Salary * 1.1 Where D in (Select D From Dept Where Dname =‘计算机’);
B.Update Teacher Set Salary = Salary * 1.1 Where D in (Select D From Dept Where Dname=‘计算机’);
C.Update Salary = Salary * 1.1 Where D in (Select D From Dept Where Dname = 计算机);
D.Update TABLE Teacher Set Salary = Salary * 1.1 Where D in (Select D From Dept Where Dname = ‘计算机’);
-
11、雇员关系EMP和部门关系DEPT如下表所示。其中雇员关系表EMP定义雇员号为主键,部门号为外键,部门信息表DEPT定义部门号为主键。 EMP DEPT 雇员号 雇员名 部门号 工资 部门号 部门名 地址 001 010 056 101 张 山 王宏达 马林生 赵 敏 02 01 02 04 2000 1200 1000 1500 01 02 03 04 业务部 销售部 服务部 财务部 1号楼 2号楼 3号楼 4号楼 下面列出的操作不能成功执行的是()。
A.从EMP中删除行(‘010’,‘王宏达’,‘01’,1200)
B.在EMP中插入行(‘102’,‘赵敏’,‘01’,1500)
C.将EMP中雇员号=‘056’的工资改为1600元
D.将EMP中雇员号=‘101’的部门号改为‘05’
-
1、在bookshop数据库中有5 个表,这五个表的结构描述见“实验数据库描述”。其中员工表employee(emp_no,emp_name,sex,dept,title,date_hired,birthday,salary,telephone,addr),客户表customer(cust_name,receiver,tel_no,cust_Addr),图书表books(book_no,book_name,price,book_type,ISBN),销售主表sales(order_no,cust_name,sale_id,total_amt,order_date),销售明细表sale_item(order_no,book_no,qty,unit_price),以下操作不能正确执行的是()。
A.insert into books values('20888',34.5,'C程序设计','计算机','97810345678')
B.假设书号为20652的图书已经被选购了。 delete from books where book_no='20652'
C.假设books表中并没有编号为20888的图书。 update sale_item set book_no='20888' where order_no='102893'
D.update books set price='abc' where book_no='20652'