A
@akanthiya
aggregate function
create table product(id varchar2(10),product namevarchar2(20),price number(5),quantity number(5));
insert into product values(001,'mouse',4000,5);
insert into product values(002,'keyboard',6000,8);
insert into product values(003,'printer',7000,6);
insert into product values(004,'cpu',9000,10);
insert into product values(005,'monitor',8000,9);
select*from product;
select count(*)from product;
select max (quantity) from product;
select min(quantity)from product;
logical operation
create table employee(id number(5),name varchar2(20),age number(4),salary number(7),address varchar2(20)
);
insert into employee values(001,'ammu',35,4500,'delhi');
insert into employee values(002,'anu',23,6000,'mumbai');
insert into employee values(003,'kavya',63,2000,'uk');
insert into employee values(004,'swetha',53,4000,'usa');
insert into employee values(005,'swety',73,1000,'new york');
select *from employee;
select*from employee where age>=63 and salary>=2000;
ddl
create table customer(id number(5),name varchar(7),post varchar(6));
insert into customer values(001,'ammu','hr');
insert into customer values(002,'anu','manager');
alter table customer add age number(2);
select*from customer;
update customer set age=30 where id=001;
string function
create table customer(id number(5),firstname varchar2(20),lastname varchar2(20),purchase product varchar2(20),price decimal(5));
insert into customer values(001,'akshaya','ammu','printer',3000.50);
insert into customer values(002,'anu','eadagam','mouse',4000.50);
insert into customer values(003,'ajith','kumar','keyboard',5000);
select*from customer;
select cast(price as integer)intprice from customer;
select firstname||''||lastname from customer where id=002;
select instr(firstname,'a')from cus
logical program
create table customer(id number(4),name varchar2(20),age number(4),addresss varchar2(20),salary number(7));
insert into customer values(1,'anu',23,'delhi',30000);
insert into customer values(1,'ammu',33,'madurai',20000);
insert into customer values(1,'anitha',27,'dubai',10000);
select*from customer;
select*from customer where age<=27 AND salary>=20000;
string of customer
create table customer(id number(5),firstname varchar2(20),lastname varchar2(20),purchase product varchar2(30),price decimal(5));
insert into customer values(001,'ammu','anu','printer',4566.9);
insert into customer values(002,'bala','bharath','apple laptop',4556.8);
insert into customer values(003,'hardrick','pandiya','keyboard',5000.6);
insert into customer values(004,'thava','mani','cpu',3000.7);
select*from customer;
select id, cast(price as integer)intprice from customer;
select firstname ca
create table employee with attribute empid,salary,name,designation
create table employee (empid number(5),name varchar2(20),salary number(7),des varchar2(16));
insert into employee values(1001,'abi',20000,'manager');
insert into employee values(1002,'anu',40000,'hr');
insert into employee values(1003,'ammu',50000,'ass.manager');
select*from employee;
alter table employee add experience number(5);
update employee set experience=8 where empid=1001;
update employee set experience=7 where empid=1003;
select empid,name where salary>10000 and experience>5;