单选题Which of the following statements eliminates all but one of each set of duplicate rows in the DEPT column in the STAFF table?()A SELECT UNIQUE dept FROM staffB SELECT DISTINCT dept FROM staffC SELECT (dept) UNIQUE FROM staffD SELECT (dept) DISTINCT FRO

题目
单选题
Which of the following statements eliminates all but one of each set of duplicate rows in the DEPT column in the STAFF table?()
A

SELECT UNIQUE dept FROM staff

B

SELECT DISTINCT dept FROM staff

C

SELECT (dept) UNIQUE FROM staff

D

SELECT (dept) DISTINCT FROM staff

参考答案和解析
正确答案: C
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

根据SQL标准,要查询表student中平均年龄age小于21的所在系dept及其平均年龄值,下面哪条语句适用?()

A select dept,avg(age) from student where avg(age)<21

B select dept,avg(age) from student group by dept having avg(age)<21

C select dept,avg(age) from student having avg(age)<21

D select dept,avg(age) from student group by dept where avg(age)<21


参考答案B

第2题:

Examine the description of the EMPLOYEES table:EMP_ID NUMBER(4) NOT NULLLAST_NAME VARCHAR2(30) NOT NULLFIRST_NAME VARCHAR2(30)DEPT_ID NUMBER(2)JOB_CAT VARCHARD2(30)SALARY NUMBER(8,2)Which statement shows the maximum salary paid in each job category of each department? ()

A. SELECT dept_id, job_cat, MAX(salary) FROM employees WHERE salary > MAX (salary);

B. SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept_id,job_cat;

C. SELECT dept_id, job_cat, MAX(salary) FROM employees;

D. SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept_id;

E. SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept _ id job _ cat salary;


参考答案:B

第3题:

Evaluate this SQL statement:SELECT e.emp_name, d.dept_nameFROM employees eJOIN departments dUSING (department_id)WHERE d.department_id NOT IN (10,40)ORSER BY dept_name;The statement fails when executed. Which change fixes the error? ()

A. remove the ORDER BY clause

B. remove the table alias prefix from the WHERE clause

C. remove the table alias from the SELECT clause

D. prefix the column in the USING clause with the table alias

E. prefix the column in the ORDER BY clause with the table alias

F. replace the condition "d.department_id NOT IN (10,40)" in the WHERE clause with "d.department_id <> 10 AND d.department_id <> 40"


参考答案:C

第4题:

找出emp表中的dept表没有的dept_no 使用Exists方式实现 即改写select * from emp a where a.dept_no not in (select b.dept_no from dept b)


正确答案:SELECT *   FROM EMP A  WHERE NOT EXISTS  
 (SELECT 1 FROM DEPT B WHERE A.DEPT_NO = B. DEPT_NO) 

第5题:

查询全体主管的姓名(m name)、出生年份(birth)和所在部门(dept),要求用小写字母表示所有部门名,数据表名为manager实现该功能的语句为________。

A.select"m_name",出生年份:,birth,islower(dept)from manager

B.select m_name,"出生年份:",birth,islower(dept)from manager

C.select m_name,"出生年份:",birth,dept from manager

D.select m_name,"出生年份:",birth,upper(dept)from manager


正确答案:B
解析:查询全体主管的姓名(m_name)、出生年份(birth)和所在部门(dept),要求用小写字母表示所有部门名。数据表为manager实现该功能的语句为:
  select m_name,"出生年份:",birth, islower(dept)
  from manager;

第6题:

根据SQL标准,创建一个视图abc,通过该视图只能对表student中系dept为‘IS’的记录进行更新操作。下面哪条语句适用?()

A create view abc as select * from student where dept=’IS’

B create view abc as select * from student where dept=’IS’ with check option

C create view abc as student where dept=’IS’

D create view abc as select dept=’IS’ from student


参考答案B 单选题

第7题:

Scott issues the SQL statements:CREATE TABLE dept(deptno NUMBER(2),dname VARCHAR2(14),loc VARCHAR2(13)};GRANT SELECTON DEPTT0 SUE;If Sue needs to select from Scott‘s DEPT table, which command should she use?()

A.SELECT*FROMDEPT;

B.SELECT*FROMSCOTT.DEPT;

C.SELECT*FROMDBASCOTTDEPT;

D.SELECT*FROMALL_USERSWHEREUSER_NAME=‘;SCOTT‘;ANDTABLENAME=‘;DEPT‘;;


参考答案:B

第8题:

The user Alice wants to grant all users query privileges on her DEPT table. Which SQL statement accomplishes this? ()

A. GRANT select ON dept TO ALL_ USER;

B. GRANT select ON dept TO ALL;

C. GRANT QUERY ON dept TO ALL_USERS

D. GRANT select ON dept TO PUBLIC;


参考答案:D

第9题:

Which of the following statements eliminates all but one of each set of duplicate rows in the DEPT column in the STAFF table?()

A.SELECT UNIQUE dept FROM staff

B.SELECT DISTINCT dept FROM staff

C.SELECT (dept) UNIQUE FROM staff

D.SELECT (dept) DISTINCT FROM staff


参考答案:B

第10题:

使用HQL查询所有部门信息,以下正确的是()。

  • A、from Dept
  • B、select*from cn.jbit.demo.entity.Dept
  • C、select Dept from cn.jbit.demo.entity.Dept d
  • D、select d from Dept d

正确答案:A,D

更多相关问题