1z0-071 Exam QuestionsBrowse all questions from this exam

1z0-071 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?

Show Answer
Correct Answer: B,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

8 comments
Sign in to comment
zouveOption: B
Jul 4, 2023

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.

ShrimathiOption: D
Jul 19, 2023

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
Aug 2, 2023

Scott can create synonym. Tested.

AlexAFJOption: D
Aug 31, 2023

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.

XTIMONOption: D
Sep 10, 2023

D is correct

FestoOption: B
Nov 6, 2023

B. 2, 3, and 4

lucemqyOption: D
Nov 15, 2023

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

yaya32Option: D
Jan 25, 2024

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

Ayman_Khalifa
Jul 15, 2024

Why A is incorrect?