Aim:

To explore the count and character functions using SQL queries.

Algorithm:

Step 1: Start the program.

Step 2: Create the Table.

Step 3: Insert the values using DML commands.

Step 4: View the full table.

Step 5: Execute the count and character functions in the table.

Step 6: Get the output.

Step 7: Stop the program.

Program


create table customer(ID number,Name varchar(20),Age number, City varchar(10), salary number)
insert into customer  values (1, 'Ramesh', 32, 'Ahmedabad', 2000);
insert into customer values (2, 'Khilan', 25, 'Delhi', Null);
insert into customer values (3, 'kaushik', 23, 'Kota', 2000);
insert into customer values (4, 'Chaitali', 25, 'Mumbai', Null);
insert into customer values (5, 'Hardik', 27, 'Bhopal', 8500);
insert into customer values (6, 'Komal', 22, 'MP', 4500);

select*from customer;



select count(*)from customer;



select count(distinct salary)from customer; 



select count(all salary)from customer;


Character Function:


select LOWER('SAMI') from dual;




select UPPER('sami') from dual;


select INITCAP('john raj') from dual;


select LENGTH('RTYUIOKP') from dual;


select SUBSTR('SRMVCAS',5,3)from dual;


select CONCAT( 'Naveen' ,'Android') from dual;


select LPAD('100',5,'*') from dual;


select RPAD('5000',7,'*') from dual;


select TRIM('G' FROM 'GEEKS') from dual;


select REPLACE('I  am in BCA', 'BCA','MCA') from dual;


select TRANSLATE( '+91 25-2469782464', '0123456789-+','6789012345+-' )encode_number from dual;


select SOUNDEX('Juice'), SOUNDEX('Banana')from dual;


select LTRIM('     INTERFACE     ') from dual;


select RTRIM('     INTERFACE     ') from dual;


Post a Comment

Previous Post Next Post