单项选择题

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

A. The set of statements contains an error and does not work.
B. It creates a role called REGISTRAR, adds the MODIFY privilege on the STUDENT_GRADES object to the role, and gives the REGISTRAR role to three users.
C. It creates a role called REGISTRAR, adds the UPDATE privilege on the STUDENT_GRADES object to the role, and gives the REGISTRAR role to three users.
D. It creates a role called REGISTRAR, adds the UPDATE privilege on the STUDENT_GRADES object to the role, and creates three users with the role.
E. It creates a role called REGISTRAR, adds the UPDATE privilege on three users, and gives the REGISTRAR role to the STUDENT_GRADES object.
F. It creates a role called STUDENT_GRADES, adds the UPDATE privilege on three users, and gives the UPDATE role to the registrar.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

Examine the data from the ORDERS and CUSTOMERS tables.

Evaluate the SQL statement:

What is the result when the query is executed?()

A.
B.
C.
D. The query fails because the subquery returns more than one row.
E. The query fails because the outer query and the inner query are using different tables.

2.单项选择题Which view should a user query to display the columns associated with the constraints on a table owned by the user?()

A. USER_CONSTRAINTS
B. USER_OBJECTS
C. ALL_CONSTRAINTS
D. USER_CONS_COLUMNS
E. USER_COLUMNS

3.单项选择题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;

4.单项选择题

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_SEQEMP_NAME and JOB_ID: As specified by the user during run time, through substitution 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);

5.单项选择题Which constraint can be defined only at the column level?()

A. UNIQUE
B. NOT NULL
C. CHECK
D. PRIMARY KEY
E. FOREIGN KEY

6.多项选择题In which two cases would you use an outer join?()

A. The tables being joined have NOT NULL columns.
B. The tables being joined have only matched data.
C. The columns being joined have NULL values.
D. The tables being joined have only unmatched data.
E. The tables being joined have both matched and unmatched data.
F. Only when the tables have a primary key/foreign key relationship.

7.单项选择题

The PRODUCTS table has these columns:
PRODUCT_ID NUMBER(4)
PRODUCT_NAME VARCHAR2(45)
PRICE NUMBER(8,2)
Evaluate this SQL statement:
SELECT *
FROM PRODUCTS
ORDER BY price, product _ name;
What is true about the SQL statement?()

A. The results are not sorted.
B. The results are sorted numerically.
C. The results are sorted alphabetically.
D. The results are sorted numerically and then alphabetically.

8.单项选择题

Examine the structure of the EMPLOYEES, DEPARTMENTS, and TAX tables.

For which situation would you use a nonequijoin query?()

A. To find the tax percentage for each of the employees.
B. To list the name, job id, and manager name for all the employees.
C. To find the name, salary, and department name of employees who are not working with Smith.
D. To find the number of employees working for the Administrative department and earning less then 4000.
E. To display name, salary, manager ID, and department name of all the employees, even if the employees do not have a department ID assigned.

9.单项选择题

Examine the structure of the EMPLOYEES and DEPARTMENTS tables:
EMPLOYEES
EMPLOYEE_ID NUMBER
DEPARTMENT_ID NUMBER
MANAGER_ID NUMBER
LAST_NAME VARCHAR2(25)
DEPARTMENTS
DEPARTMENT_ID NUMBER
MANAGER_ID NUMBER
DEPARTMENT_NAME VARCHAR2(35)
LOCATION_ID NUMBER
You want to create a report displaying employee last names, department names, and locations. Which query should you use to create an equi-join?()

A. SELECT last_name, department_name, location_id FROM employees , department ;
B. SELECT employees.last_name, departments.department_name, departments.location_id FROM employees e, departments D WHERE e.department_id = d.department_id;
C. SELECT e.last_name, d.department_name, d.location_id FROM employees e, departments D WHERE manager_id = manager_id;
D. SELECT e.last_name, d.department_name, d.location_id FROM employees e, departments D WHERE e.department_id = d.department_id;

10.单项选择题Which best describes an inline view?()

A. a schema object
B. a subquery that can contain an ORDER BY clause
C. another name for a view that contains group functions
D. a subquery that is part of the FROM clause of another query