AUTHORIZATION is a reserved SQL keyword used as a clause inside certain Data Definition Language (DDL) statements to assign ownership of the newly created object to a specific database principal (user or role). In Standard SQL and in several major database engines, AUTHORIZATION appears chiefly in CREATE SCHEMA and CREATE VIEW statements.1. CREATE SCHEMA – When you supply AUTHORIZATION, the schema is created under the named principal, regardless of the login that executed the statement, provided the caller has sufficient rights. This allows a database administrator to create schemas for other users without switching sessions.2. CREATE VIEW – In the SQL standard, AUTHORIZATION can also appear in CREATE VIEW to record who is considered the definer of the view for privilege-checking. (Support varies by product.)AUTHORIZATION does not grant privileges; it simply sets ownership. Owners implicitly receive full privileges on their objects. Dropping or altering the object later is subject to normal ownership rules.Caveats:- The specified principal must already exist.- In most systems, only superusers or principals with CREATE ANY SCHEMA (or equivalent) can create a schema owned by someone else.- Confusing AUTHORIZATION with GRANT leads to incorrect security assumptions; GRANT is still needed to let others use the object.- Some dialects (e.g., PostgreSQL) limit AUTHORIZATION use to CREATE SCHEMA, while others (e.g., SQL Server) also allow it in CREATE SCHEMA ... AUTHORIZATION and ALTER AUTHORIZATION statements.
schema_name
- STRING Optional in many dialects. Name of the schema being created. If omitted, the principal name is often reused.SQL-92
Typically you need elevated rights: database owner, superuser, or CREATE ANY SCHEMA permission. Without these, specifying another principal raises an error.
No. The clause only sets the owner. To let additional users use the schema or view, issue explicit GRANT statements.
Yes, many dialects offer ALTER AUTHORIZATION or ALTER SCHEMA ... TRANSFER OWNERSHIP commands. You must be the current owner or a superuser.
No. MySQL ignores this clause or raises a syntax error. Use GRANT and ALTER statements instead to manage ownership.