0% found this document useful (0 votes)
21 views6 pages

Practical No 6 DBMS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views6 pages

Practical No 6 DBMS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Practical No.

6 :- Execute SQL Queries Using Arithmetic, Comparisons, Logical,


Set, Between and Like Operators.
Name:-Deepak Yadav
Roll No:-220463
Q.1] Create the Table Employee and Execute the Following Queries:
Ans:-
SQL>Create Table Emp10(emp_no number(10),e_name varchar(10),dept_no
number(3),dept_name varchar(10),job_id number(10),Salary
number(6),hiredate date);
Table created.
SQL> insert into Emp10
values(1000,'Deepak',201,'Production',220463,45000,'15-Aug-2000');
1 row created.
SQL> insert into Emp10 values(1001,'Sandeep',202,'Sales',220464,40000,'15-
Sep-2000');
1 row created.
SQL> insert into Emp10 values(1002,'Ashish',202,'Sales',220465,40000,'15-Sep-
2001');
1 row created.
SQL> insert into Emp10
values(1003,'Shreyas',201,'Production',220453,45000,'15-Sep-2002');
1 row created.
SQL> insert into Emp10 values(1003,'Shri',301,'Clerk',220461,35000,'15-Nov-
2005');
1 row created.
SQL> insert into Emp10 values(1003,'Shreya',200,'Director',220401,55000,'26-
Nov-2000');
1 row created.
a. Select E_name, (Salary*.20) ass Incremented_Salary from Emp;

b. Select E_name, Emp_no from Emp10 where Salary<=50000 and >=25000;

c. Select Details of Employes Having Salary more than Sandeep Salary;

d. Select * from Emp10 Where Dept_no<>201;


Q.2] Create Tabel Employee and Department. Execute the Following Queries.

1.Select * from Emp10 union Select * from Dept1;

2. Select * from Emp10 intersect Select * from Dept1;

3. Select * from Emp10 minus Select * from Dept1;


4. Select * from Emp10 where Salary emp_no between 1000 and 2000;

5. Select * from Emp10 where e_name IN(‘Shreyas’);

Q.3] Create Tabel Employee and Department. Execute the Following Queries:-
a. Select e_name from Emp10 where Job_id!=220463.

b. Display names of all employees whose name is exactly 6 characters long.

c. List all Employees information except job_id=220463 and job_id=220453.


d. List the Employee name and salary whose salary is not in the range of 35000
to 40000.

e. List Common e_name from Emp and Dept Tables. Display the name of
employee whose salary becomes more than 50000 after giving 15% increment.

Q.4] Execute and Write output of the following Queries:-

a. Select from Emp where Salary >40000 AND Dept Name=‘Sales’;

b. Select from Emp where NOT (Dept Name ‘Sales’);


c. Select from Emp where E_name like ‘_s%’

You might also like