You are on page 1of 1

(1) Give details of customers ANIL.

==> select * from deposit,borrow where deposit.cname='ANIL' and borrow.cname='AN


IL' and borrow.bname=deposit.bname;
(2) Give name of customer who are borrowers and depositors and having living cit
y nagpur
==> select deposit.cname,borrow.cname from deposit,borrow,customers where deposi
t.cname=customers.cname and borrow.cname=customers.cname and customers.city='NAG
PUR';
(3) Give name of customers and their branch name who 'nagpur'.
==> select deposit.bname,deposit.cname from customers,deposit where customers.ci
ty='NAGPUR' and deposit.cname=customers.cname;
write a query to display avg salary being paid each job title whithin department
(4) Write a query to display the last name, department number, and department na
me for all employees.
select emp_name,dept_no from employee;
(5) display job id dept. no. and department location
create table department(dep_no varchar2(20),loacation varchar2(20));
add column in department table of dep_no
insert into department values('10','rajkot');
insert into department values('13','ahemdabad');
insert into department values('20','somnath');
insert into department values('25','jamnagar');
insert into department values('35','surat');
insert into department values('40','vadodara');
select job.job_id,department.dep_no,department.location from job,department wher
e job.dep_no=department.dep_no;
(6) Write a query to display the employee name, department number, and departmen
t name for all employees who work in NEW YORK.
==> select employee.emp_name,employee.dept_no,department.location from employee,
department where department.dep_no=employee.dept_no;
(7) Display the employee last name and employee number Label the columns Employe
e, Emp#, respectively.
==> select emp_no"Employee number",emp_name"Employee name" from employee;
(8) Create a query to display the name and hire date of any employee hired after
employee aman.
==> select emp_name,hire_date from employee where hire_date>(select hire_date fr
om employee where emp_name='aman');

You might also like