In this post, I will discuss about the Data Definition Language (DDL). What is Data Definition Language (DDL)? Data Definition Language (DDL) is a language Structured Query Language (SQL) used to define, delete, grant access and analyze the objects contained in a database.
The SQL commands belonging to the Data Definition Language (DDL) is as follows:1. Object databases
  • Command to create table -> CREATE TABLE employee;
  • Command to change the table structure -> ALTER TABLE employee;
  • The command to remove the tables from the database or the database -> DROP TABLE employee;
  • Command to empty the contents of the table -> TRUNCATE employees;
  • Command to rename table -> employees RENAME TO employee;
  • Command to make comments on tables or columns -> COMMENT ON TABLE employees IS 'table for employees'; COMMENT ON COLUMN pegawai.id_pegawai IS 'contains an employee number';
2. Permissions
  • Command to create a new user. Example: CREATE USER IDENTIFIED BY ade ade;
  • Command to change user's password. Examples of ALTER USER IDENTIFIED BY Dedek ade;
  • The command to melock or mengunlock a user. Example: ALTER USER ACCOUNT LOCK ade; ALTER USER ACCOUNT UNLOCK ade;
  • Command to delete user -> DROP USER ade;
  • The command to add permissions to a user -> GRANT insert, update ON employees TO ade;
  • Command to create a role (set permissions) -> CREATE ROLE manipulation; GRANT dba TO manipulation;
  • Command to delete the role -> DROP ROLE manipulation;
  • The command to revoke privileges from a user -> REVOKE FROM manipulation ade;
Additional:
  • Command to view the rights of existing privileges -> SELECT name FROM system_privilege_map;
  • Command to see what permissions can be granted to a user -> SELECT * FROM user_sys_privs;
  • Command to see what permissions have been granted to a user -> SELECT * FROM user_tab_privs_recd;
  • The command to look at the role permissions -> SELECT * FROM WHERE Grantee dba_sys_privs IN ('connect', 'resource');
  • Command to see if a role has a password -> SELECT * FROM dba_rules;
That was a brief description of Structured Data Definition Language (DDL). Actually there is also Data Manipulation Language (DML), but I have discussed in other posts. If there are errors or omissions please justified or added. May be useful.

0 komentar

Related Posts Plugin for WordPress, Blogger...