SQL> create table emptable466 (eid number(2),enmae varchar (7),sal number(5),comm number(5),job varchar(10),dno number(2)); Table created. SQL> insert into emptable466 values (11,'Pujan',50000,5000,'Engineer',10); 1 row created. SQL> insert into emptable466 values (12,'Kartik',60000,5000,'Manager',20); 1 row created. SQL> insert into emptable466 values (13,'Shubh',65000,6000,'CA',30); 1 row created. SQL> insert into emptable466 values (14,'Jinesh',55000,9000,'Engineer',10); 1 row created. SQL> insert into emptable466 values (15,'Ashutosh',65000,9000,'Engineer',10); insert into emptable466 values (15,'Ashutosh',65000,9000,'Engineer',10) * ERROR at line 1: ORA-12899: value too large for column "SYSTEM"."EMPTABLE466"."ENMAE" (actual: 8, maximum: 7) SQL> insert into emptable466 values (15,'Ashu',65000,9000,'Engineer',10); 1 row created. SQL> SQL> SQL> insert into emptable466 values (16,'Palli',60000,9000,'Engineer',10); 1 row created. SQL> insert into emptable466 values (17,'Raju',15000,1000,'Clerk',40); 1 row created. SQL> insert into emptable466 values (18,'Babu',12500,1000,'Clerk',40); 1 row created. SQL> insert into emptable466 values (19,'Shyaam',14000,1000,'Clerk',40); 1 row created. SQL> SQL> SQL> SQL> select * from emptable466; EID ENMAE SAL COMM JOB DNO ---------- ------- ---------- ---------- ---------- ---------- 11 Pujan 50000 5000 Engineer 10 12 Kartik 60000 5000 Manager 20 13 Shubh 65000 6000 CA 30 14 Jinesh 55000 9000 Engineer 10 15 Ashu 65000 9000 Engineer 10 16 Palli 60000 9000 Engineer 10 17 Raju 15000 1000 Clerk 40 18 Babu 12500 1000 Clerk 40 19 Shyaam 14000 1000 Clerk 40 9 rows selected. SQL> commit 2 SQL> commit; Commit complete. SQL> SQL> SQL> SQL> select enmae,job,sal from emptable466 order by job; ENMAE JOB SAL ------- ---------- ---------- Shubh CA 65000 Raju Clerk 15000 Shyaam Clerk 14000 Babu Clerk 12500 Palli Engineer 60000 Jinesh Engineer 55000 Pujan Engineer 50000 Ashu Engineer 65000 Kartik Manager 60000 9 rows selected. SQL> select eid,enmae from emptable466 where job='Manager'; EID ENMAE ---------- ------- 12 Kartik SQL> SQL> SQL> SQL> SQL> SQL> select * from emptable466 where comm>sal; no rows selected SQL> SQL> SQL> SQL> SQL> SQL> SQL> select sum(sal) from emptable466; SUM(SAL) ---------- 396500 SQL> SQL> SQL> SQL> select enmae,sal from emptable466 where (select sal from emptable466 where job='Manager')<(select sal from emptable466 where job! ='Manager'); select enmae,sal from emptable466 where (select sal from emptable466 where job=' Manager')<(select sal from emptable466 where job!='Manager') * ERROR at line 1: ORA-01427: single-row subquery returns more than one row SQL> select enmae,sal from emptable466 where (select sal from emptable466 where job='Manager')<(select sal from emptable466); select enmae,sal from emptable466 where (select sal from emptable466 where job=' Manager')<(select sal from emptable466) * ERROR at line 1: ORA-01427: single-row subquery returns more than one row SQL> SQL> SQL> SQL> select enmae,sal from emptable466 where (select sal from emptable466 where job='Manager')<(select sal from emptable466); select enmae,sal from emptable466 where (select sal from emptable466 where job=' Manager')<(select sal from emptable466) * ERROR at line 1: ORA-01427: single-row subquery returns more than one row SQL> SQL> SQL> SQL> SQL> SQL> SQL> select enmae,sal from emptable466 where sal>(select sal from emptable466 wh ere job='Manager'); ENMAE SAL ------- ---------- Shubh 65000 Ashu 65000 SQL> SQL> SQL> SQL> select enmae,sal from emptable466 where sal<(select sal from emptable466 wh ere job='Manager'); ENMAE SAL ------- ---------- Pujan 50000 Jinesh 55000 Raju 15000 Babu 12500 Shyaam 14000 SQL> SQL> SQL> SQL> SQL> SQL> select min(sal) from emptable466 group by dno; MIN(SAL) ---------- 65000 60000 12500 50000 SQL> select min(sal) from emptable466 group by dno; MIN(SAL) ---------- 65000 60000 12500 50000 SQL> SQL> SQL> SQL> SQL> SQL> SQL> select enmae,sal,sal*12 from emptable466; ENMAE SAL SAL*12 ------- ---------- ---------- Pujan 50000 600000 Kartik 60000 720000 Shubh 65000 780000 Jinesh 55000 660000 Ashu 65000 780000 Palli 60000 720000 Raju 15000 180000 Babu 12500 150000 Shyaam 14000 168000 9 rows selected. SQL> select enmae,sal,sal*12 as AnnualIncome from emptable466; ENMAE SAL ANNUALINCOME ------- ---------- ------------ Pujan 50000 600000 Kartik 60000 720000 Shubh 65000 780000 Jinesh 55000 660000 Ashu 65000 780000 Palli 60000 720000 Raju 15000 180000 Babu 12500 150000 Shyaam 14000 168000 9 rows selected. SQL> SQL> SQL> SQL> SQL> SQL> SQL> select * from emptable466 where sal>=20000 and sal<60000; EID ENMAE SAL COMM JOB DNO ---------- ------- ---------- ---------- ---------- ---------- 11 Pujan 50000 5000 Engineer 10 14 Jinesh 55000 9000 Engineer 10 SQL> select * from emptable466 where sal>=20000 and sal<=60000; EID ENMAE SAL COMM JOB DNO ---------- ------- ---------- ---------- ---------- ---------- 11 Pujan 50000 5000 Engineer 10 12 Kartik 60000 5000 Manager 20 14 Jinesh 55000 9000 Engineer 10 16 Palli 60000 9000 Engineer 10 SQL> select *,sal*12 as AnnInc from emptable466 order by sal; select *,sal*12 as AnnInc from emptable466 order by sal * ERROR at line 1: ORA-00923: FROM keyword not found where expected SQL> SQL> SQL> SQL> select * as AnnInc from emptable466 order by sal; select * as AnnInc from emptable466 order by sal * ERROR at line 1: ORA-00923: FROM keyword not found where expected SQL> select * from emptable466 order by sal; EID ENMAE SAL COMM JOB DNO ---------- ------- ---------- ---------- ---------- ---------- 18 Babu 12500 1000 Clerk 40 19 Shyaam 14000 1000 Clerk 40 17 Raju 15000 1000 Clerk 40 11 Pujan 50000 5000 Engineer 10 14 Jinesh 55000 9000 Engineer 10 12 Kartik 60000 5000 Manager 20 16 Palli 60000 9000 Engineer 10 13 Shubh 65000 6000 CA 30 15 Ashu 65000 9000 Engineer 10 9 rows selected. SQL> SQL> SQL> SQL> select eid,enmae,sal,comm,job,dno,sal*12 as annInc from emptable466 order b y sal; EID ENMAE SAL COMM JOB DNO ANNINC ---------- ------- ---------- ---------- ---------- ---------- ---------- 18 Babu 12500 1000 Clerk 40 150000 19 Shyaam 14000 1000 Clerk 40 168000 17 Raju 15000 1000 Clerk 40 180000 11 Pujan 50000 5000 Engineer 10 600000 14 Jinesh 55000 9000 Engineer 10 660000 12 Kartik 60000 5000 Manager 20 720000 16 Palli 60000 9000 Engineer 10 720000 13 Shubh 65000 6000 CA 30 780000 15 Ashu 65000 9000 Engineer 10 780000 9 rows selected.