Experiment-08
Object: To perform the string function in
simple database table.
Requirement: Windows XP, Oracle 9i.
Program Code And Output :
SQL>
select lower('ABHI')"Lower" from dual;
Lower
----
abhi
SQL>
select upper('abhi')"Upper" from dual;
Upper
----
ABHI
SQL>
select initcap('abhi anand')"init" from dual;
init
------------
AbhiAnand
SQL>
select substr('ABHI',2,3)"SubString"from dual;
SubS
----
BHI
SQL>
select ascii('a'),ascii('A') from dual;
ASCII('a')
ASCII('A')
----------
----------
97 65
SQL> select length('abhi') from dual;
LENGTH('ABHI')
------------------
5
SQL>
select ltrim('Abhi','A') from dual;
LTRIM('A
--------
bhia
SQL>
select rtrim('Abhi','a') from dual;
RTRIM
-----
Abhi
SQL>
select concat('Priya','nka') from dual;
CONCAT('
--------
Priyanka
SQL>
create table emp09(Emp_Name varchar2(20));
Table
created.
SQL>insert into emp09 values(‘adit’);
1.row
created.
SQL>insert into emp09 values(‘raj’);
1.row
created.
SQL>insert into emp09 values(‘rajesh’);
1.row
created.
SQL>insert into emp09 values(‘rajindra’);
1.row
created.
SQL>
select Emp_Name from emp09 where soundex(Emp_Name)=soundex('raj');
EMP_NAME
--------------------
raj
SQL>
select Emp_Name from emp09 where Emp_Name like 'r%';
EMP_NAME
--------------------
raj
rajesh
rajindra
SQL>
select Emp_Name from emp09 where Emp_Name like '%a';
EMP_NAME
--------------------
rajindra
SQL>
select Emp_Name from emp09 where Emp_Name like '_a%';
EMP_NAME
--------------------
raj
rajesh
rajindra
Result:The string function in simple
database table has been implemented successfully.
0 comments:
Post a Comment