Skip to main content

Posts

Showing posts with the label DDL

Drop Command (DDL) in SQL Oracle With Implementation

 Drop Command (DDL) in SQL Oracle With Implementation For Explanation Watch Video:: Drop Command Used to delete  table (rows X columns) EX::: 1)Create table SQL> create table emp01(fname varchar2(15),sal Number(10)); Table created. 2)Describe table SQL> desc emp01;  Name                                      Null?    Type  ----------------------------------------- -------- ----------------------------  FNAME                                              VARCHAR2(15)  SAL                                                NUMBER(10) SQL> select * from emp01; no rows selected 3)Insert values into table SQL> insert into emp01 values('smith',500000); 1 row created. 4)Drop the table SQL> drop table emp01; Table dropped. 5)TO see columns deleted again describe table SQL> desc emp01; ERROR: ORA-04043: object emp01 does not exist 6_to see data deleted SQL> select * from emp01; select * from emp01               * ERROR at line 1: ORA-00942: table or view does not exist

Truncate Command (DDL) in SQL Oracle With Implementation

 Truncate Command (DDL) in SQL Oracle With Implementation For Explanation Watch Video:: Truncate:    -TO delete all rows from table at a time    - Deleting rows but not column    - By using this cmd we cant delete specific row from table    -It doesnt support where clause EX::: SQL> create table emp01(fname varchar2(10),sal Number(10)); Table created. SQL> insert into empo1 values('miller',500000); insert into empo1 values('miller',500000)             * ERROR at line 1: ORA-00942: table or view does not exist SQL> insert into emp01 values('miller',500000); 1 row created. SQL> insert into emp01 values('Baburao',50000); 1 row created. SQL> insert into emp01 values('Smith',500000); 1 row created. SQL> select * from emp01; FNAME             SAL ---------- ---------- miller         500000 Baburao         50000 Smith          500000 SQL> truncate table emp01; Table truncated. After Truncate:: SQL> select * from emp01; no rows se

Rename Command (DDL) in SQL Oracle With Implementation

 Rename Command (DDL) in SQL Oracle With Implementation For explanation watch Video:: Rename command :: Used to change the name of table SQL> desc emp01;  Name                                      Null?    Type  ----------------------------------------- -------- ----------------------------  FNAME                                              VARCHAR2(15)  SAL                                                NUMBER(10) SQL> rename emp01 to emp02; Table renamed. SQL> desc emp01; ERROR: ORA-04043: object emp01 does not exist SQL> desc emp02;  Name                                      Null?    Type  ----------------------------------------- -------- ----------------------------  FNAME                                              VARCHAR2(15)  SAL                                                NUMBER(10)

ALTER Command (DDL) in SQL Oracle with Implementation on ORACLE

 ALTER Command (DDL) in SQL Oracle with Implementation on ORACLE For Explanation Watch video: 1)Alter Modify :: to modify column name or datatype EX:: SQL> create table emp01(name char(10),sal Number(10)); Table created. SQL> desc emp01;  Name                                      Null?    Type  ----------------------------------------- -------- ----------------------------  NAME                                               CHAR(10)  SAL                                                NUMBER(10) SQL> alter table emp01 modify name varchar2(10); Table altered. SQL> desc Emp01;  Name                                      Null?    Type  ----------------------------------------- -------- ----------------------------  NAME                                               VARCHAR2(10)  SAL                                                NUMBER(10) SQL> alter table emp01 modify name varchar2(15)/*to change the size of varchar2*/; Table altered. SQL> desc emp01;  Name