Multiple choice technology databases

There are 2 schemas – S1 and S2 in a database. S1 has a table T1 in it. The following command is executed from the DBA user: Create public synonym S2.SYN_T1 for S1.T1 What will be the result?

  1. Public synonym will be created

  2. Only a private synonym will be created

  3. Error

  4. Public synonym will be created, but accessible only from S2

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The CREATE PUBLIC SYNONYM command creates a public synonym in the database's public schema, not in a specific user's schema like S2. Oracle does not allow specifying a schema name (like S2) when creating a public synonym - public synonyms are stored in a special PUBLIC schema accessible to all users. The syntax 'Create public synonym S2.SYN_T1 for S1.T1' is invalid because it attempts to qualify a public synonym with a schema name, which will result in an error.