Manish Sharma
Manish Sharma
Manish Sharma
All rights reserved. Connected to: Personal Oracle8 Release 8.0.3.0.0 - Production With the Partitioning and Objects options PL/SQL Release 8.0.3.0.0 - Production SQL> CREATE TABLE EMPLOYEE 2 (EMPLOYEE_ID VARCHAR(4) PRIMARY KEY, 3 EMPLOYEE_NAME VARCHAR(10), 4 DESIGNATION VARCHAR(10), 5 DEPARTMENT VARCHAR (10), 6 CASUAL_LEAVE NUMBER(2), 7 MEDICAL_LEAVE NUMBER(2), 8 SALARY NUMBER (6)); Table created. SQL> DESC EMPLOYEE Name Null? Type ------------------------------- -------- ---EMPLOYEE_ID NOT NULL VARCHAR2(4) EMPLOYEE_NAME VARCHAR2(10) DESIGNATION VARCHAR2(10) DEPARTMENT VARCHAR2(10) CASUAL_LEAVE NUMBER(2) MEDICAL_LEAVE NUMBER(2) SALARY NUMBER(6) SQL> INSERT INTO EMPLOYEE 2 (EMPLOYEE_ID,EMPLOYEE_NAME,DESIGNATION,DEPARTMENT,CASUAL_L EAVE,MEDICAL_LEAVE,SALARY) 3 VALUES 4 ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE,&SAL ARY); Enter value for employee_id: A122 Enter value for employee_name: RAMESH Enter value for designation: EXECUTIVE Enter value for department: HR Enter value for casual_leave: 8
Enter value for medical_leave: 7 Enter value for salary: 12000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('A122','RAMESH ','EXECUTIVE','HR',8,7,12000) 1 row created. SQL> / Enter value for employee_id: A134 Enter value for employee_name: RAHUL Enter value for designation: EXECUTIVE Enter value for department: SALES Enter value for casual_leave: 7 Enter value for medical_leave: 8 Enter value for salary: 15000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('A134','RAHUL','EXECUTIVE','SALES',7,8,15000) 1 row created. SQL> / Enter value for employee_id: A234 Enter value for employee_name: SAHIL Enter value for designation: EXECUTIVE Enter value for department: MARKETING Enter value for casual_leave: 5 Enter value for medical_leave: 7 Enter value for salary: 18000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('A234','SAHIL','EXECUTIVE','MARKETING',5,7,18000) 1 row created. SQL> / Enter value for employee_id: Z123 Enter value for employee_name: MANISH Enter value for designation: MANAGER Enter value for department: HR Enter value for casual_leave: 7
Enter value for medical_leave: 4 Enter value for salary: 25000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('Z123','MANISH','MANAGER','HR',7,4,25000) 1 row created. SQL> / Enter value for employee_id: NEHA Enter value for employee_name: Enter value for designation: Enter value for department: Enter value for casual_leave: Enter value for medical_leave: Enter value for salary: old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('NEHA','','','',,,) ('NEHA','','','',,,) * ERROR at line 4: ORA-00936: missing expression SQL> / Enter value for employee_id: A765 Enter value for employee_name: NEHA Enter value for designation: MANAGER Enter value for department: HR Enter value for casual_leave: 9 Enter value for medical_leave: 3 Enter value for salary: 25000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('A765','NEHA','MANAGER','HR',9,3,25000) 1 row created. SQL> / Enter value for employee_id: A876 Enter value for employee_name: MOHIT Enter value for designation: MANAGER
Enter value for department: HR Enter value for casual_leave: 10 Enter value for medical_leave: 10 Enter value for salary: 28000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('A876','MOHIT','MANAGER','HR',10,10,28000) 1 row created. SQL> / Enter value for employee_id: A836 Enter value for employee_name: PANKAJ Enter value for designation: EXECUTIVE Enter value for department: HR Enter value for casual_leave: 11 Enter value for medical_leave: 6 Enter value for salary: 45000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('A836','PANKAJ','EXECUTIVE','HR',11,6,45000) 1 row created. SQL> / Enter value for employee_id: Z168 Enter value for employee_name: FARAH Enter value for designation: EXECUTIVE Enter value for department: SALES Enter value for casual_leave: 13 Enter value for medical_leave: 12 Enter value for salary: 20000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('Z168','FARAH','EXECUTIVE','SALES',13,12,20000) 1 row created. SQL> / Enter value for employee_id: S567 Enter value for employee_name: RAHUL Enter value for designation: MANAGER Enter value for department: MARKETING
Enter value for casual_leave: 14 Enter value for medical_leave: 2 Enter value for salary: 25000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('S567','RAHUL','MANAGER','MARKETING',14,2,25000) 1 row created. SQL> / Enter value for employee_id: S156 Enter value for employee_name: DISHANT Enter value for designation: MANAGER Enter value for department: HR Enter value for casual_leave: 6 Enter value for medical_leave: 6 Enter value for salary: 24000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('S156','DISHANT','MANAGER','HR',6,6,24000) 1 row created. SQL> / Enter value for employee_id: D234 Enter value for employee_name: RAVI Enter value for designation: EXECUTIVE Enter value for department: HR Enter value for casual_leave: 4 Enter value for medical_leave: 4 Enter value for salary: 25000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('D234','RAVI','EXECUTIVE','HR',4,4,25000) 1 row created. SQL> / Enter value for employee_id: D109 Enter value for employee_name: MADHU Enter value for designation: MANAGER Enter value for department: SALES Enter value for casual_leave: 3
Enter value for medical_leave: 6 Enter value for salary: 24000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('D109','MADHU','MANAGER','SALES',3,6,24000) 1 row created. SQL> / Enter value for employee_id: RAVI Enter value for employee_name: F123 Enter value for designation: EXECUTIVE Enter value for department: MARKETING Enter value for casual_leave: 7 Enter value for medical_leave: 8 Enter value for salary: 23000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('RAVI','F123','EXECUTIVE','MARKETING',7,8,23000) 1 row created. SQL> / Enter value for employee_id: D287 Enter value for employee_name: MANJIT Enter value for designation: EXECUTIVE Enter value for department: HR Enter value for casual_leave: 3 Enter value for medical_leave: 4 Enter value for salary: 21000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('D287','MANJIT','EXECUTIVE','HR',3,4,21000) 1 row created. SQL> / Enter value for employee_id: G156 Enter value for employee_name: RAM Enter value for designation: PRESIDENT Enter value for department: SALES Enter value for casual_leave: 8 Enter value for medical_leave: 8
Enter value for salary: 50000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('G156','RAM','PRESIDENT','SALES',8,8,50000) 1 row created. SQL> / Enter value for employee_id: H167 Enter value for employee_name: MANJU Enter value for designation: MANAGER Enter value for department: MARKETING Enter value for casual_leave: 3 Enter value for medical_leave: 3 Enter value for salary: 23000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('H167','MANJU','MANAGER','MARKETING',3,3,23000) 1 row created. SQL> / Enter value for employee_id: H124 Enter value for employee_name: SURESH Enter value for designation: EXECUTIVE Enter value for department: HR Enter value for casual_leave: 7 Enter value for medical_leave: 7 Enter value for salary: 34000 old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('H124','SURESH','EXECUTIVE','HR',7,7,34000) 1 row created. SQL> / Enter value for employee_id: K876 Enter value for employee_name: KHALID Enter value for designation: MANAGER Enter value for department: MARKETING Enter value for casual_leave: 10 Enter value for medical_leave: 11 Enter value for salary: 19000
old 4: ('&EMPLOYEE_ID','&EMPLOYEE_NAME','&DESIGNATION','&DEPARTMENT',& CASUAL_LEAVE,&MEDICAL_LEAVE, new 4: ('K876','KHALID','MANAGER','MARKETING',10,11,19000) 1 row created. SQL> SELECT * FROM EMPLOYEE; EMPL EMPLOYEE_N DESIGNATIO DEPARTMENT CASUAL_LEAVE MEDICAL_LEAVE SALARY ---- ---------- ---------- ---------- ------------ ------------- --------A122 RAMESH EXECUTIVE HR 8 7 12000 A134 RAHUL EXECUTIVE SALES 7 8 15000 A234 SAHIL EXECUTIVE MARKETING 5 7 18000 Z123 MANISH MANAGER HR 7 4 25000 A765 NEHA MANAGER HR 9 3 25000 A876 MOHIT MANAGER HR 10 10 28000 A836 PANKAJ EXECUTIVE HR 11 6 45000 Z168 FARAH EXECUTIVE SALES 13 12 20000 S567 RAHUL MANAGER MARKETING 14 2 25000 S156 DISHANT MANAGER HR 6 6 24000 D234 RAVI EXECUTIVE HR 4 4 25000 D109 MADHU MANAGER SALES 3 6 24000 RAVI F123 EXECUTIVE MARKETING 7 8 23000 D287 MANJIT EXECUTIVE HR 3 4 21000 G156 RAM PRESIDENT SALES 8 8 50000 H167 MANJU MANAGER MARKETING 3 3 23000 H124 SURESH EXECUTIVE HR 7 7 34000 K876 KHALID MANAGER MARKETING 10 11 19000 18 rows selected. SQL> SELECT EMPLOYEE_NAME FROM EMPLOYEE 2 WHERE DEPARTMENT = 'HR' AND DESIGNATION = 'MANAGER'; EMPLOYEE_N ---------MANISH NEHA MOHIT DISHANT SQL> SELECT EMPLOYEE_NAME FROM EMPLOYEE 2 WHERE SALARY = (SELECT MIN(SALARY) FROM EMPLOYEE);