单项选择题

Examine the description of the EMPLOYEES table:
EMP_ID NUMBER(4) NOT NULL
LAST_NAME VARCHAR2(30) NOT NULL
FIRST_NAME VARCHAR2(30)
DEPT_ID NUMBER(2)
Which statement produces the number of different departments that have employees with last name Smith?()

A. SELECT COUNT (*) FROM employees WHERE last _name='smith';
B. SELECT COUNT (dept_id) FROM employees WHERE last _name='smith';
C. SELECT DISTINCT (COUNT (dept_id) FROM employees WHERE last _name='smith';
D. SELECT COUNT (DISTINCT dept_id) FROM employees WHERE last _name='smith';
E. SELECT UNIQE (dept_id) FROM employees WHERE last _name='smith';


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题Which is an iSQL*Plus command?()

A. INSERT
B. UPDATE
C. SELECT
D. DESCRIBE
E. DELETE
F. RENAME

2.单项选择题Which SQL statement would you use to remove a view called EMP_DEPT_VU from your schema?()

A. DROP emp_dept_uv;
B. DELETE emp_dept_uv;
C. REMOVE emp_dept_uv;
D. DROP VIEW emp_dept_uv;
E. DELETE VIEW emp_dept_uv;
F. REMOVE VIEW emp_dept_uv;

3.多项选择题

Examine the data from the EMP table:

The COMMISSION column shows the monthly commission earned by the employee.Which three tasks would require subqueries or joins in order to perform in a single step?()

A. Deleting the records of employees who do not earn commission.
B. Increasing the commission of employee 3 by the average commission earned in department 20.
C. Finding the number of employees who do NOT earn commission and are working for department 20.
D. Inserting into the table a new employee 10 who works for department 20 and earns a commission that is equal to the commission earned by employee 3.
E. Creating a table called COMMISSION that has the same structure and data as the columns EMP_ID and COMMISSIONS of the EMP table.
F. Decreasing the commission by 150 for the employees who are working in department 30 and earning a commission of more then 800.

4.多项选择题Which four are valid Oracle constraint types? ()

A. CASCADE
B. UNIQUE
C. NONUNIQUE
D. CHECK
E. PRIMARY KEY
F. CONSTANT
G. NOT NULL

5.单项选择题

The EMPLOYEES table contains these columns:
EMPLOYEE_ID NUMBER(4)
ENAME VARCHAR2 (25)
JOB_ID VARCHAR2(10)
Which SQL statement will return the ENAME, length of the ENAME, and the numeric position of the letter "a" in the ENAME column, for those employees whose ENAME ends with a the letter "n"?()

A. SELECT ENAME, LENGTH(ENAME), INSTR(ENAME, 'a') FROM EMPLOYEES WHERE SUBSTR (ENAME, -1,1) = 'n';
B. SELECT ENAME, LENGTH(ENAME), INSTR(ENAME, ,-1,1) FROM EMPLOYEES WHERE SUBSTR (ENAME, -1,1) = 'n';
C. SELECT ENAME, LENGTH(ENAME), SUBSTR(ENAME, -1,1) FROM EMPLOYEES WHERE INSTR (ENAME, 1,1) = 'n';
D. SELECT ENAME, LENGTH(ENAME), SUBSTR(ENAME, -1,1) FROM EMPLOYEES WHERE INSTR (ENAME, -1,1) = 'n';

6.单项选择题

Examine the structure of the EMP_DEPT_VU view:
Column Name Type Remarks
EMPLOYEE_ID NUMBER From the EMPLOYEES table
EMP_NAME VARCHAR2(30) From the EMPLOYEES table
JOB_ID VARCHAR2(20) From the EMPLOYEES table
SALARY NUMBER From the EMPLOYEES table
DEPARTMENT_ID NUMBER From the DEPARTMENTS table
DEPT_NAME VARCHAR2(30) From the DEPARTMENTS table
Which SQL statement produces an error?()

A. SELECT * FROM emp_dept_vu;
B. SELECT department_id, SUM(salary) FROM emp_dept_vu GROUP BY department _ id;
C. SELECT department_id, job_id, AVG(salary) FROM emp_dept_vu GROUP BY department _ id, job_id;
D. SELECT job_id, SUM(salary) FROM emp_dept_vu WHERE department_id IN (10,20) GROUP BY job_id HAVING SUM (salary) > 20000
E. None of the statements produce an error; all are valid.

7.多项选择题Which four statements correctly describe functions that are available in SQL?()

A. INSTR returns the numeric position of a named character.
B. NVL2 returns the first non-null expression in the expression list.
C. TRUNCATE rounds the column, expression, or value to n decimal places.
D. DECODE translates an expression after comparing it to each search value.
E. TRIM trims the heading of trailing characters (or both) from a character string.
F. NVL compares two expressions and returns null if they are equal, or the first expression of they are not equal.
G. NULLIF compares twp expressions and returns null if they are equal, or the first expression if they are not equal.

8.单项选择题

Examine the structure of the EMPLOYEES and NEW_EMPLOYEES tables:
EMPLOYEES
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2 (25)
LAST_NAME VARCHAR2 (25)
HIRE_DATE DATE
NEW EMPLOYEES
EMPLOYEE_ID NUMBER Primary Key
NAME VARCHAR2 (60)
Which DELETE statement is valid?()

A. DELETE FROM employees WHERE employee_id = (SELECT employee_id FROM employees);
B. DELETE * FROM employees WHERE employee_id = (SELECT employee_id FROM new_ employees);
C. DELETE FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE name = ('Carrey')'
D. DELETE * FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE last_ name = ('Carrey')'

最新试题

Which is a valid CREATE TABLE statement? ()

题型:单项选择题

In which two cases would you use an outer join? ()

题型:多项选择题

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

题型:单项选择题

Examine these statements:CREATE ROLE registrarGRANT UPDATE ON dtudent_grades TO registrar;GRANT registrar to user1, user2, user3;What does this set of SQL statements do? ()

题型:单项选择题

Examine the structure of the STUDENTS table:STUDENT_ID NUMBER NOT NULL, Primary KeySTUDENT_NAME VARCHAR2(30)COURSE_ID VARCHAR2(10) NOT NULLMARKS NUMBERSTART_DATE DATEFINISH_DATE DATEYou need to create a report of the 10 students who achieved the highest ranking in the course INT SQL and who completed the course in the year 1999.Which SQL statement accomplishes this task? ()

题型:单项选择题

What is true regarding subqueries?()

题型:单项选择题

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? ()

题型:单项选择题

Examine the statement: Create synonym emp for hr. employees; What happens when you issue the statement? ()

题型:单项选择题

You need to perform these tasks:1. Create and assign a MANAGER role to Blake and Clark2. Grant CREATE TABLE and CREATE VIEW privileges to Blake and ClarkWhich set of SQL statements achieves the desired results? ()

题型:单项选择题

Which constraint can be defined only at the column level? ()

题型:单项选择题