Exam 1z0-071 All QuestionsBrowse all questions from this exam
Question 221

User HR has CREATE SESSION, CREATE ANY TABLE and UNLIMITED TABLESPACE privileges.

User SCOTT has CREATE SESSION, CREATE TABLE and UNLIMITED TABLESPACE privileges.

HR successfully executes this statement:

HR attempts to execute:

1. INSERT INTO scott.products VALUES (1, 'LAPTOP');

SCOTT attempts to execute:

2. SELECT * FROM products;

3. INSERT INTO scott.products VALUES (2, 'HDD');

4. CREATE SYNONYM prod FOR products;

Which will execute successfully?

    Correct Answer: D

    User HR has the CREATE ANY TABLE privilege, which allows them to create tables in any schema, including SCOTT’s. Therefore, HR can create the table in SCOTT’s schema. However, HR does not have the INSERT privilege on SCOTT’s table, so statement 1 will fail. User SCOTT, having CREATE SESSION and CREATE TABLE privileges, can query (SELECT) and insert (INSERT) into the table in their own schema, thereby making statements 2 and 3 successful. However, to create a synonym, additional privileges are needed beyond those given, thus statement 4 will not execute successfully.

Discussion
XTIMONOption: D

D is correct

AlexAFJOption: D

Tested, you cannot create synonyms nor views without premission even if you are trying to do it for a object in your schema or if you want to use your schema table as a underlying table for view.

ShrimathiOption: D

option D Since scott has privileges create session,table and unlimited table space, the user has not rights to create synonym unless he has create synonym privilege given to scott.

Alex72

Scott can create synonym. Tested.

zouveOption: B

User HR has the CREATE ANY TABLE privilege, which allows them to create a table in another user’s schema. In this case, HR successfully creates the products table in SCOTT’s schema. However, HR does not have the INSERT privilege on SCOTT’s products table, so statement 1 will fail. User SCOTT has the CREATE SESSION and CREATE TABLE privileges, which allow them to log in to the database and create tables in their own schema. Since the products table is in SCOTT’s schema, SCOTT can query and insert data into the table, so statements 2 and 3 will execute successfully. SCOTT also has the privilege to create a synonym in their own schema, so statement 4 will execute successfully.

Ayman_Khalifa

Why A is incorrect?

yaya32Option: D

I think D is correct as you need permission to create synonym

lucemqyOption: D

D 2,3 only You need explicit permission to create synonym even in your own schema https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/CREATE-SYNONYM.html#GUID-A806C82F-1171-478E-A910-F9C6C42739B2

FestoOption: B

B. 2, 3, and 4