单项选择题

You need to create a view EMP_VU. The view should allow the users to manipulate the records of only the employees that are working for departments 10 or 20.
Which SQL statement would you use to create the view EMP_VU?()

A. CREATE VIEW emp_vu AS   SELECT *   FROM employees   WHERE department_id IN (10,20);
B. CREATE VIEW emp_vu AS   SELECT *   FROM employees   WHERE department_id IN (10,20)   WITH READ ONLY;
C. CREATE VIEW emp_vu AS   SELECT *   FROM employees   WHERE department_id IN (10,20)   WITH CHECK OPTION;
D. CREATE FORCE VIEW emp_vu AS   SELECT *   FROM employees   WHERE department_id IN (10,20);
E. CREATE FORCE VIEW emp_vu AS   SELECT *   FROM employees   WHERE department_id IN (10,20)   NO UPDATE;


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

Evaluate the SQL statement:
SELECT ROUND(45.953, -1), TRUNC(45.936, 2)
FROM dual;
Which values are displayed?()

A. 46 and 45
B. 46 and 45.93
C. 50 and 45.93
D. 50 and 45.9
E. 45 and 45.93
F. 45.95 and 45.93

2.单项选择题Which SQL statement accepts user input for the columns to be displayed, the table name, and WHERE condition?()

A. SELECT &1, "&2" FROM &3 WHERE last_name = '&8';
B. SELECT &1, '&2' FROM &3 WHERE '& last_name = '&8';
C. SELECT &1, &2 FROM &3 WHERE last_name = '&8';
D. SELECT &1, '&2' FROM EMP WHERE last_name = '&8';

3.多项选择题

From SQL*Plus, you issue this SELECT statement:

You use this statement to retrieve data from a data table for()。

A. Updating
B. Viewing
C. Deleting
D. Inserting
E. Truncating

4.单项选择题

EMPLOYEES and DEPARTMENTS data:
EMPLOYEES
DEMP_NAME DEPT_ID MGR_ID JOB_ID SALARY
EMPLOYEE_I
101 Smith 20 120 SA_REP 4000
102 Martin 10 105 CLERK 2500
103 Chris 20 120 IT_ADMIN 4200
104 John 30 108 HR_CLERK 2500
105 Diana 30 108 IT_ADMIN 5000
106 Smith 40 110 AD_ASST 3000
108 Jennifer 30 110 HR_DIR 6500
110 Bob 40 EX_DIR 8000
120 Ravi 20 110 SA_DIR 6500
DEPARTMENTS
DEPARTMENT_ID DEPARTMENT_NAME
10 Admin
20 Education
30 IT
40 Human Resources
On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID managers and refers to the EMPLOYEE_ID.
On the DEPARTMENTS table DEPARTMENT_ID is the primary key.
Evaluate this UPDATE statement.
UPDATE employees
SET mgr_id =
(SELECT mgr_id
FROM employees
WHERE dept_id=
(SELECT department_id
FROM departments
WHERE department_name = 'Administration')),
Salary = (SELECT salary
FROM employees
WHERE emp_name = 'Smith')
WHERE job_id = 'IT_ADMIN';
What happens when the statement is executed?()

A. The statement executes successfully, leaves the manager ID as the existing value, and changes the salary to 4000 for the employees with ID 103 and 105.
B. The statement executes successfully, changes the manager ID to NULL, and changes the salary to 4000 for the employees with ID 103 and 105.
C. The statement executes successfully, changes the manager ID to NULL, and changes the salary to 3000 for the employees with ID 103 and 105.
D. The statement fails because there is more than one row matching the employee name Smith.
E. The statement fails because there is more than one row matching the IT_ADMIN job ID in the EMPLOYEES table.
F. The statement fails because there is no 'Administration' department in the DEPARTMENTS table.

5.单项选择题

Evaluate this SQL statement:

What will happen if you remove all the parentheses from the calculation?()

A. The value displayed in the CALC_VALUE column will be lower.
B. The value displayed in the CALC_VALUE column will be higher.
C. There will be no difference in the value displayed in the CALC_VALUE column.
D. An error will be reported.

6.多项选择题Which two statements are true about WHERE and HAVING clauses? ()

A. A WHERE clause can be used to restrict both rows and groups.
B. A WHERE clause can be used to restrict rows only.
C. A HAVING clause can be used to restrict both rows and groups.
D. A HAVING clause can be used to restrict groups only.
E. A WHERE clause CANNOT be used in a query of the query uses a HAVING clause.
F. A HAVING clause CANNOT be used in subqueries.

7.单项选择题Which SELECT statement will the result ‘ello World’ from the string ‘Hello World’?()

A. SELECT SUBSTR( ‘Hello World’,1) FROM dual;
B. SELECT INITCAP(TRIM (‘Hello World’, 1,1)) FROM dual;
C. SELECT LOWER(SUBSTR(‘Hello World’, 1, 1) FROM dual;
D. SELECT LOWER(SUBSTR(‘Hello World’, 2, 1) FROM dual;
E. SELECT LOWER(TRIM (‘H’ FROM ‘Hello World’)) FROM dual;

8.多项选择题Which two statements about creating constraints are true? ()

A. Constraint names must start with SYS_C
B. All constraints must be defines at the column level
C. Constraints can be created after the table is created
D. Constraints can be created at the same time the table is created
E. Information about constraints is found in the VIEW_CONSTRAINTS dictionary view

9.单项选择题

The CUSTOMERS table has these columns:

Which statement finds the rows in the CUSTOMERS table that do not have a postal code?()

A. SELECT customer_id, customer_name   FROM customers   WHERE postal_code CONTAINS NULL;
B. SELECT customer_id, customer_name   FROM customers   WHERE postal_code = '________';
C. SELECT customer_id, customer_name   FROM customers   WHERE postal_code IS NULL;
D. SELECT customer_id, customer_name   FROM customers   WHERE postal code IS NVL;
E. SELECT customer_id, customer_name   FROM customers   WHERE postal_code = NULL;

10.单项选择题You are granted the CREATE VIEW privilege. What does this allow you to do?()

A. Create a table view.
B. Create a view in any schema.
C. Create a view in your schema.
D. Create a sequence view in any schema.
E. Create a view that is accessible by everyone.
F. Create a view only of it is based on tables that you created.

最新试题

Evaluate the SQL statement: TRUNCATE TABLE DEPT; Which three are true about the SQL statement? ()

题型:多项选择题

Which is a valid CREATE TABLE statement? ()

题型:单项选择题

Which two statements about subqueries are true? ()

题型:多项选择题

Which two statements are true about constraints? ()

题型:多项选择题

User Mary has a view called EMP_DEPT_LOC_VU that was created based on the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables. She has the privilege to create a public synonym, and would like to create a synonym for this view that can be used by all users of the database. Which SQL statement can Mary use to accomplish that task?()

题型:单项选择题

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

题型:单项选择题

Which four are types of functions available in SQL? ()

题型:多项选择题

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary KeyFIRST_NAME VARCHAR2 (25)LAST_NAME VARCHAR2 (25)HIRE_DATE DATEWhich UPDATE statement is valid? ()

题型:单项选择题

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 structure of the EMPLOYEES table:EMPLOYEE_ID NUMBER NOT NULL, Primary KeyEMP_NAME VARCHAR2(30)JOB_ID NUMBER\SAL NUMBERMGR_ID NUMBER References EMPLOYEE_ID columnDEPARTMENT_ID NUMBER Foreign key to DEPARTMENT_ID column of the DEPARTMENTS table You created a sequence called EMP_ID_SEQ inorderto populate sequential values for the EMPLOYEE_ID column of the EMPLOYEES table. Which two statements regarding the EMP_ID_SEQ sequence are true? ()

题型:多项选择题