READ Free Dumps For Oracle- 1z0-007
Question ID 7842 | 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;
|
Option A | You obtain the results retrieved from the public synonym HR created by the database administrator.
|
Option B | You obtain the results retrieved from the HR table that belongs to your schema.
|
Option C | You get an error message because you cannot retrieve from a table that has the same name as a public synonym.
|
Option 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.
|
Option 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.
|
Correct Answer | B |
Explanation Explanation/Reference: Explanation: By executing this query you will extract data from the HR table in your own schema, it will not work with HR synonym for the HUMAN_RESOURCES table of the GENERAL schema. Incorrect Answers A: The results will be retrieved from the table in your own schema, not from the GENERAL schema, using synonym HR. C: There is no error: data from the table in your own schema will be retrieved by this query. D: This query will not generate Cartesian product from both tables. E: This query will not retrieve data from both tables as a FULL JOIN. OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 331-335 Chapter 7: Creating Other Database Objects in Oracle
Question ID 7844 | Which two statements about views are true? (Choose two.)
|
Option A | A view can be created as read only.
|
Option B | A view can be created as a join on two or more tables.
|
Option C | A view cannot have an ORDER BY clause in the SELECT statement.
|
Option D | A view cannot be created with a GROUP BY clause in the SELECT statement.
|
Option E | A view must have aliases defined for the column names in the SELECT statement.
|
Correct Answer | AB |
Explanation Explanation/Reference: Explanation: A view can becreated as read only object. However, it is possible to change data in the underlying table(s) with some restrictions.A view also can be created as a join on two or more tables. This type of view is called complex view. Complex views provide complicated data models where many base tables are drawn together into one virtual table. Incorrect Answers C: Query operations containing ORDER BY clause are also permitted, so long as the ORDER BY clause appearsoutside the parentheses. The following is an example of what I mean: CREATE VIEW my_view AS (SELECT*FROM emp) ORDER BYempno. D: A view can be created with a GROUP BY clause in the SELECT statement. E: It is not required to have aliases defined for the column names in the SELECT statement. OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 292-309 Chapter 7: Creating Other Database Objects in Oracle