单项选择题The database administrator of your company created a public synonym called HR for the HUMAN_RESOURCES table of the GENERAL schema, because many users frequently use this table. As a user of the database, you created a table called HR in your schema. What happens when you execute this query? SELECT * FROM HR; ()

A. You obtain the results retrieved from the public synonym HR created by the database administrator.
B. You obtain the results retrieved from the HR table that belongs to your schema.
C. You get an error message because you cannot retrieve from a table that has the same name as a public synonym.
D. You obtain the results retrieved from both the public synonym HR and the HR table that belongs to your schema, as a Cartesian product.
E. You obtain the results retrieved from both the public synonym HR and the HR table that belongs to your schema, as a FULL JOIN.


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题

Examine the data in the EMPLOYEES table:

Which three subqueries work? ()

A. SELECT * FROM employees where salary > (SELECT MIN(salary) FROM employees GROUP BY department _ id);
B. SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department _ id);
C. SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department _ id);
D. SELECT department_id FROM employees WHERE SALARY > ALL (SELECT AVG(salary) FROM employees GROUP BY department _ id);
E. SELECT last_name FROM employees Where salary > ANY (SELECT MAX(salary) FROM employees GROUP BY department _ id);
F. SELECT department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM employees GROUP BY ANG (SALARY));

2.单项选择题You need to give the MANAGER role the ability to select from, insert into, and modify existing rows in the STUDENT_GRADES table. Anyone given this MANAGER role should be able to pass those privileges on to others. Which statement accomplishes this? ()

A. GRANT select, insert, update ON student_grades TO manager
B. GRANT select, insert, update ON student_grades TO ROLE manager
C. GRANT select, insert, modify ON student_grades TO manager WITH GRANT OPTION;
D. GRANT select, insert, update ON student_grades TO manager WITH GRANT OPTION;
E. GRANT select, insert, update ON student_grades TO ROLE manager WITH GRANT OPTION;  
F.GRANT select, insert, modify ON student_grades TO ROLE manager WITH GRANT OPTION;

3.多项选择题

Examine the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
Which three statements inserts a row into the table? ()

A. INSERT INTO employees VALUES (NULL, 'JOHN','Smith');
B. INSERT INTO employees( first_name, last_name) VALUES ('JOHN','Smith');
C. INSERT INTO employees VALUES ('1000','JOHN','NULL');
D. INSERT INTO employees(first_name,last_name, employee_id) VALUES ('1000, 'john','Smith');
E. INSERT INTO employees (employee_id) VALUES (1000);
F. INSERT INTO employees (employee_id, first_name, last_name) VALUES ( 1000, 'john',");

4.多项选择题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.

5.单项选择题In which case would you use a FULL OUTER JOIN?()

A. Both tables have NULL values.
B. You want all unmatched data from one table.
C. You want all matched data from both tables.
D. You want all unmatched data from both tables.
E. One of the tables has more data than the other.
F. You want all matched and unmatched data from only one table.

6.多项选择题

Examine the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
Which three statements inserts a row into the table? ()

A. INSERT INTO employees VALUES (NULL, 'JOHN','Smith');
B. INSERT INTO employees( first_name, last_name) VALUES ('JOHN','Smith');
C. INSERT INTO employees VALUES ('1000','JOHN','NULL');
D. INSERT INTO employees(first_name,last_name, employee_id) VALUES ('1000, 'john','Smith');
E. INSERT INTO employees (employee_id) VALUES (1000);
F. INSERT INTO employees (employee_id, first_name, last_name) VALUES ( 1000, 'john',");

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 name = 'carrey');

9.多项选择题

Evaluate this SQL statement:
SELECT e.emp_name, d.dept_name
FROM employees e
JOIN departments d
USING (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"

10.多项选择题Which three statements about subqueries are true? ()

A. A main query can have more than one subquery.
B. A subquery can have more than one main query.
C. The subquery and main query must retrieve data from the same table.
D. The subquery and main query can retrieve data from different tables.
E. Only one column or expression can be compared between the subquery and main query.
F. Multiple columns or expression can be compared between the subquery and main query.