单项选择题

Examine the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
HIRE_DATE DATE
You issue these statements:
CREATE table new_emp ( employee_id NUMBER, name VARCHAR2(30)); INSERT INTO new_emp SELECT employee_id , last_name from employees;
Savepoint s1;
UPDATE new_emp set name = UPPER(name);
Savepoint s2;
Delete from new_emp;
Rollback to s2;
Delete from new_emp where employee_id =180;
UPDATE new_emp set name = 'James';
Rollback to s2;
UPDATE new_emp set name = 'James' WHERE employee_id =180;
Rollback;
At the end of this transaction, what is true?()

A.You have no rows in the table.
B.You have an employee with the name of James.
C.You cannot roll back to the same savepoint more than once.
D.Your last update fails to update any rows because employee ID 180 was already deleted.


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题

Examine the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER NOT NULL, Primary Key
EMP_NAME VARCHAR2(30)
JOB_ID NUMBER
SAL NUMBER
MGR_ID NUMBER References EMPLOYEE_ID column
DEPARTMENT_ID NUMBER Foreign key to DEPARTMENT_ID column of the DEPARTMENTS table
You created a sequence called EMP_ID_SEQ in order to populate sequential values for the EMPLOYEE_ID column of the EMPLOYEES table.
Which two statements regarding the EMP_ID_SEQ sequence are true? ()

A.You cannot use the EMP_ID_SEQ sequence to populate the JOB_ID column.
B.The EMP_ID_SEQ sequence is invalidated when you modify the EMPLOYEE_ID column.
C.The EMP_ID_SEQ sequence is not affected by modifications to the EMPLOYEES table.
D.Any other column of NUMBER data type in your schema can use the EMP_ID_SEQ sequence.
E.The EMP_ID_SEQ sequence is dropped automatically when you drop the EMPLOYEES table.
F.The EMP_ID_SEQ sequence is dropped automatically when you drop the EMPLOYEE_ID column.

2.多项选择题Which three are DATETIME data types that can be used when specifying column definitions?()

A.TIMESTAMP
B.INTERVAL MONTH TO DAY
C.INTERVAL DAY TO SECOND
D.INTERVAL YEAR TO MONTH
E.TIMESTAMP WITH DATABASE TIMEZONE

3.单项选择题

Examine the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER NOT NULL
EMP_NAME VARCHAR2(30)
JOB_ID VARCHAR2(20)
SAL NUMBER
MGR_ID NUMBER
DEPARTMENT_ID NUMBER
You want to create a SQL script file that contains an INSERT statement. When the script is run, the INSERT statement should insert a row with the specified values into the EMPLOYEES table. The INSERT statement should pass values to the table columns as specified below:
EMPLOYEE_ID: Next value from the sequence
EMP_ID_SEQ EMP_NAME and JOB_ID: As specified by the user during run time, throughsubstitution variables
SAL: 2000
MGR_ID: No value
DEPARTMENT_ID: Supplied by the user during run time through
substitution variable. The INSERT statement should fail if the user supplies a value other than 20 or 50.
Which INSERT statement meets the above requirements?()

A.INSERT INTO employees VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
B.INSERT INTO employees VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did IN (20,50));
C.INSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50)) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
D.INSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50) WITH CHECK OPTION) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
E.INSERT INTO (SELECT * FROM employees WHERE (department_id = 20 AND department_id = 50) WITH CHECK OPTION ) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);

4.单项选择题You need to perform certain data manipulation operations through a view called EMP_DEPT_VU, which you previously created. You want to look at the definition of the view (the SELECT statement on which the view was created.) How do you obtain the definition of the view?()

A.Use the DESCRIBE command on the EMP_DEPT_VU view.
B.Use the DEFINE VIEW command on the EMP_DEPT_VU view.
C.Use the DESCRIBE VIEW command on the EMP_DEPT_VU view.
D.Query the USER_VIEWS data dictionary view to search for the EMP_DEPT_VU view.
E.Query the USER_SOURCE data dictionary view to search for the EMP_DEPT_VU view.
F.Query the USER_OBJECTS data dictionary view to search for the EMP_DEPT_VU view.

5.单项选择题

Examine the description of the CUSTOMERS table:
CUSTOMER_ID NUMBER(4) NOT NULL
CUSTOMER_NAME VARCHAR2(100) NOT NULL
STREET_ADDRESS VARCHAR2(150)
CITY_ADDRESS VARCHAR2(50)
STATE_ADDRESS VARCHAR2(50)
PROVINCE_ADDRESS VARCHAR2(50)
COUNTRY_ADDRESS VARCHAR2(50)
POSTAL_CODE VARCHAR2(12)
CUSTOMER_PHONE VARCHAR2(20)
The CUSTOMER_ID column is the primary key for the table.
Which statement returns the city address and the number of customers in the cities Los Angeles or San Francisco?()

A.SELECT city_address, COUNT(*) FROM customers WHERE city_address IN ('Los Angeles', 'San Francisco');
B.SELECT city_address, COUNT(*) FROM customers WHERE city_address IN ('Los Angeles', 'San Francisco') GROUP BY city_address;
C.SELECT city_address, COUNT(customer_id) FROM customers WHERE city_address IN ('Los Angeles', 'San Francisco') GROUP BY city_address, customer_id;
D.SELECT city_address, COUNT(customer_id) FROM customers GROUP BY city_address IN ('Los Angeles', 'San Francisco');

6.单项选择题

Click the Exhibit button to examine the structures of the EMPLOYEES and TAX tables.
You need to find the percentage tax applicable for each employee. Which SQL statement would you use?()

A.SELECT employee_id, salary, tax_percent FROM employees e JOIN tax t ON e.salary BETWEEN t.min_salary AND t.max_salary;
B.SELECT employee_id, salary, tax_percent FROM employees e JOIN tax t WHERE e.salary > t.min_salary AND < t.max_salary;
C.SELECT employee_id, salary, tax_percent FROM employees e JOIN tax t ON (MIN(e.salary) = t.min_salary AND MAX(e.salary) = t.max_salary); 
D.You cannot find the information because there is no common column between the two tables.

7.单项选择题

Examine the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER NOT NULL
EMP_NAME VARCHAR2(30)
JOB_ID VARCHAR2(20) DEFAULT 'SA_REP'
SAL NUMBER
COMM_PCT NUMBER
MGR_ID NUMBER
DEPARTMENT_ID NUMBER
You need to update the records of employees 103 and 115. The UPDATE statement you specify should update the rows with the values specified below:
JOB_ID: Default value specified for this column definition.
SAL: Maximum salary earned for the job ID SA_REP.
COMM_PCT: Default value specified for this commission percentage column, if any.
If no default value is specified for the column, the value should be NULL.
DEPARTMENT_ID: Supplied by the user during run time through substitution variable.
Which UPDATE statement meets the requirements?()

A.UPDATE employees SET job_id = DEFAULT AND Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP') AND comm_pct = DEFAULT AND department_id = &did WHERE employee_id IN (103,115);
B.UPDATE employees SET job_id = DEFAULT AND Sal = MAX(sal) AND comm_pct = DEFAULT OR NULL AND department_id = &did WHERE employee_id IN (103,115) AND job_id = 'SA_REP';
C.UPDATE employeesC.UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP'), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115);
D.UPDATE employeesD.UPDATE employees SET job_id = DEFAULT, Sal = MAX(sal), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115) AND job_id = 'SA_REP';
E.UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP'), comm_pct = DEFAULT OR NULL, department_id = &did WHERE employee_id IN (103,115);

8.单项选择题

The EMPLOYEES table contains these columns:
EMPLOYEE_ID NUMBER(4)
LAST_NAME VARCHAR2 (25)
JOB_ID VARCHAR2(10)
You want to search for strings that contain 'SA_' in the JOB_ID column. Which SQL statement do you use?()
 

A.SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA\_%' ESCAPE '\';
B.SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA_';
C.SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA_' ESCAPE "\";
D.SELECT employee_id, last_name, job_id FROM employees WHERE job_id = '%SA_';

9.单项选择题What does the FORCE option for creating a view do?()

A.creates a view with constraints
B.creates a view even if the underlying parent table has constraints
C.creates a view in another schema even if you don't have privileges
D.creates a view regardless of whether or not the base tables exist

10.单项选择题What is true about updates through a view?()

A.You cannot update a view with group functions.
B.When you update a view group functions are automatically computed.
C.When you update a view only the constraints on the underlying table will be in effect.
D.When you update a view the constraints on the views always override the constraints on the underlying tables.