<\/p>\n
SQL is divided into the following :-<\/p>\n
\u00a0<\/strong><\/p>\n DRL COMMANDS<\/u><\/strong><\/p>\n CREATE TABLE<\/p>\n Syntax:<\/strong><\/p>\n Create table <table_name> (col1 datatype1, col2 datatype2 \u2026coln datatypen);<\/p>\n Create table XXSTP_EMP_DETAILS<\/p>\n (<\/p>\n Cust_ID number primary Key,<\/p>\n Cust_Name\u00a0 varchar2(200),<\/p>\n Cust_join_date date<\/p>\n );<\/p>\n \u00a0<\/strong><\/p>\n DML COMMANDS<\/u><\/strong><\/p>\n INSERT<\/u><\/strong><\/p>\n This will be used to insert the records into table.<\/p>\n We have two methods to insert.<\/p>\n Syntax:<\/strong><\/p>\n insert into <table_name> values (value1, value2, value3 \u2026. Valuen);<\/p>\n insert into XXSTP_EMP_DETAILS values (1,\u2019Rajesh\u2019,\u201901-Jan-2016\u2019);<\/p>\n insert into XXSTP_EMP_DETAILS values (2,\u2019Amit\u2019,\u201901-Feb-2016\u2019);<\/p>\n UPDATE<\/u><\/strong><\/p>\n This can be used to modify the table data.<\/p>\n Syntax:<\/strong><\/p>\n Update <table_name> set <col1> = value1, <col2> = value2 where <condition>;<\/p>\n Update XXSTP_EMP_DETAILS set Cust_Name=\u2019Rajesh Singh\u2019<\/p>\n Where cust_id=1;<\/p>\n DELETE<\/u><\/strong><\/p>\n This can be used to delete the table data temporarily.<\/p>\n Syntax:<\/strong><\/p>\n Delete <table_name> where <condition>;<\/p>\n Delete from XXSTP_EMP_DETAILS where cust_id=1;<\/p>\n Note: We have to explicitly commit the DML transactions<\/p>\n DDL COMMANDS<\/u><\/strong><\/p>\n ALTER<\/u><\/strong><\/p>\n This can be used to add or remove columns and to modify the precision of the datatype.<\/p>\n Syntax:<\/strong><\/p>\n alter table <table_name> add <col datatype>;<\/p>\n alter table XXSTP_EMP_DETAILS add Cust_Father_Name varchar2(200);<\/p>\n TRUNCATE<\/u><\/strong><\/p>\n This can be used to delete the entire table data permanently.<\/p>\n Syntax:<\/strong><\/p>\n truncate table <table_name>;<\/p>\n Truncate table XXSTP_EMP_DETAILS;<\/p>\n DROP<\/u><\/strong><\/p>\n This will be used to drop the database object;<\/p>\n Syntax:<\/strong><\/p>\n Drop table <table_name>;<\/p>\n Drop table XXSTP_EMP_DETAILS;<\/p>\n RENAME<\/u><\/strong><\/p>\n This will be used to rename the database object;<\/p>\n Syntax:<\/strong><\/p>\n rename <old_table_name> to <new_table_name>;<\/p>\n Rename XXSTP_EMP_DETAILS to XXSTP_EMPLOYEES_DETAILS;<\/p>\n Note :- DDL statements are auto-commit. We don\u2019t need to commit.<\/p>\n TCL COMMANDS<\/u><\/strong><\/p>\n COMMIT<\/u><\/strong><\/p>\n This will be used to save the work.<\/p>\n Syntax:<\/strong><\/p>\n Commit;<\/p>\n ROLLBACK<\/u><\/strong><\/p>\n This will undo the operation.<\/p>\n Syntax:<\/strong><\/p>\n Rollback;<\/p>\n SAVEPOINT<\/u><\/strong><\/p>\n You can use savepoints to rollback portions of your current set of transactions.<\/p>\n Syntax:<\/strong><\/p>\n Savepoint <savepoint_name>;<\/p>\n DCL COMMANDS<\/u><\/strong><\/p>\n DCL commands are used to granting and revoking the permissions.<\/p>\n GRANT<\/u><\/strong><\/p>\n This is used to grant the privileges to other users.<\/strong><\/p>\n Syntax:<\/strong><\/p>\n Grant <privileges> on <object_name> to <user_name> [with grant option];<\/p>\n Grant all on XXSTP_EMPLOYEES_DETAILS to ORCL;<\/p>\n REVOKE<\/u><\/strong><\/p>\n This is used to revoke the privileges from the users to which you granted the privileges.<\/p>\n Syntax:<\/strong><\/p>\n Revoke <privileges> on <object_name> from <user_name>;<\/p>\n Revoke all on XXSTP_EMPLOYEES_DETAILS from ORCL;<\/p>\n","protected":false},"excerpt":{"rendered":" SQL is divided into the following :- Data Definition Language\u00a0(DDL) Data Manipulation Language\u00a0(DML) Data Retrieval Language\u00a0(DRL) Transaction Control Language\u00a0(TCL) Data Control Language\u00a0(DCL) DDL\u00a0–\u00a0Create, Alter, Drop, Truncate, Rename DML\u00a0–\u00a0Insert, Update, Delete DRL\u00a0–\u00a0Select TCL\u00a0–\u00a0Commit, Rollback, Savepoint DCL\u00a0–\u00a0Grant, Revoke \u00a0 DRL COMMANDS CREATE TABLE Syntax: Create table <table_name> (col1 datatype1, col2 datatype2 \u2026coln datatypen); Create table XXSTP_EMP_DETAILS…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_jetpack_memberships_contains_paid_content":false},"categories":[42],"tags":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/stepforwardsolution.com\/wp-json\/wp\/v2\/posts\/3473"}],"collection":[{"href":"https:\/\/stepforwardsolution.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stepforwardsolution.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stepforwardsolution.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stepforwardsolution.com\/wp-json\/wp\/v2\/comments?post=3473"}],"version-history":[{"count":1,"href":"https:\/\/stepforwardsolution.com\/wp-json\/wp\/v2\/posts\/3473\/revisions"}],"predecessor-version":[{"id":3474,"href":"https:\/\/stepforwardsolution.com\/wp-json\/wp\/v2\/posts\/3473\/revisions\/3474"}],"wp:attachment":[{"href":"https:\/\/stepforwardsolution.com\/wp-json\/wp\/v2\/media?parent=3473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stepforwardsolution.com\/wp-json\/wp\/v2\/categories?post=3473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stepforwardsolution.com\/wp-json\/wp\/v2\/tags?post=3473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\n
\n