Bird
0
0

Which PostgreSQL command grants a user the ability to create objects in a schema named 'inventory'?

easy📝 Conceptual Q2 of 15
PostgreSQL - Roles and Security
Which PostgreSQL command grants a user the ability to create objects in a schema named 'inventory'?
AGRANT USAGE ON SCHEMA inventory TO username;
BGRANT ALL PRIVILEGES ON SCHEMA inventory TO username;
CGRANT SELECT ON SCHEMA inventory TO username;
DGRANT CREATE ON SCHEMA inventory TO username;
Step-by-Step Solution
Solution:
  1. Step 1: Identify the privileges needed for object creation

    CREATE privilege allows creating objects in a schema; USAGE allows access to the schema.
  2. Step 2: Match the correct GRANT syntax

    GRANT CREATE ON SCHEMA inventory TO username; grants the ability to create objects.
  3. Final Answer:

    GRANT CREATE ON SCHEMA inventory TO username; -> Option D
  4. Quick Check:

    CREATE privilege allows object creation [OK]
Quick Trick: CREATE privilege allows object creation [OK]
Common Mistakes:
  • Using only USAGE which doesn't allow creation
  • Using ALL PRIVILEGES which grants more than needed
  • Granting SELECT which is not a schema privilege

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes