June 24th, 2009

Data Control Language, REVOKE Cascading Privileges

Posted by admin in R. Data Control Language

When you use the CREATE TABLE statement, you are the table’s owner with SELECT, INSERT, UPDATE, DELETE, and any other privileges allowed by your RDBMS system.You can not use the CREATE VIEW statement without having at least a SELECT privilege on each of the source tables for the view, so you automatically have the SELECT privilege on the view. If you already have the INSERT, UPDATE, or DELETE privileges on the source or base table, then these privileges are automatically given to you on the view by the RDBMS system.

There are other complications that are illustrated in the examples in our course.

June 22nd, 2009

Data Definition Language, DROP ALIAS or SYNONYM

Posted by admin in Q. Data Definition Language

Format:

          DROP ALIAS alias_name;

                                     or

          DROP SYNONYM synonym_name;

This command will remove the alias or synonym.
Example:

          DROP SYNONYM PILOTS;

> Aliases and synonyms are not an SQL standard.

> DB2, Informix, and Oracle implement ALIAS and SYNONYM.

> MySQL does not implement ALIAS or SYNONYM.

June 19th, 2009

Data Definition Language, CREATE ALIAS or SYNONYM

Posted by admin in Q. Data Definition Language

Format:

          CREATE [PUBLIC | PRIVATE] ALIAS alias_name
             FOR {table_name | view_name};

or

          CREATE [PUBLIC | PRIVATE] SYNONYM synonym_name
             FOR {table_name | view_name};

An alias or synonym produces another name for a table or view.
The normal use of an alias or symonym is to avoid having to qualify another user’s table or view.
An alias or synonym simplifies the SQL statement and make it appear to be your own table.

A PRIVATE alias or synonym can only be accessed by the creator of the alias or synonym.
If unspecified, PRIVATE is the default.

A PUBLIC alias or synonym is accessible to all users of the database.
Normally only a Database Administrator or a privileged security user can create with PUBLIC.

Example:

          CREATE SYNONYM PILOTS FOR USER1.PILOT_TBL;

> Aliases and synonyms are not an SQL standard.

> DB2, Informix, and Oracle implement ALIAS and SYNONYM.

> MySQL does not implement ALIAS or SYNONYM.

« Previous PageNext Page »