Change department name to lower case : UPDATE WHERE « Insert Delete Update « Oracle PL / SQL






Change department name to lower case

   
SQL>
SQL> CREATE TABLE DEPT(
  2      DEPTNO NUMBER(2),
  3      DNAME VARCHAR2(14),
  4      LOC VARCHAR2(13)
  5  );

Table created.

SQL>
SQL> INSERT INTO DEPT VALUES (10, 'ACCOUNTING', 'NEW YORK');

1 row created.

SQL> INSERT INTO DEPT VALUES (20, 'RESEARCH', 'DALLAS');

1 row created.

SQL> INSERT INTO DEPT VALUES (30, 'SALES', 'CHICAGO');

1 row created.

SQL> INSERT INTO DEPT VALUES (40, 'OPERATIONS', 'BOSTON');

1 row created.

SQL>
SQL>
SQL>
SQL> update dept
  2     set dname = lower(dname)
  3   where deptno = 10;

1 row updated.

SQL>
SQL>
SQL>
SQL> drop table dept;

Table dropped.

   
    
    
  








Related examples in the same category

1.Modify multiple rows with a single UPDATE statement
2.Without the WHERE clause, this UPDATE affects all rows in the table
3.Update with where condition
4.Change value case with update statement